/* The suite's top-bar cluster: apps, notifications, quick settings, account (0.2.28).
 *
 * The look the owner approved ("It looks beautiful, let's go with it"), written against the page's own theme tokens and not the
 * mockups' hexes, so one cluster wears all sixteen themes and an operator's own: the dark theme is the default look and the
 * light one follows the same layout through the same names (--void, --slab, --line, --text, --muted, --amber, --mint, --alarm,
 * --ink and the derived layer web/style.css defines). The markup is web/suite.js's; the landing page, which has no script,
 * draws the same classes by hand for the part that needs none:
 *
 *   <div class="suite-cluster" data-suite-app="land">
 *     <details class="suite-slot suite-slot--apps">
 *       <summary class="suite-btn" aria-label="Yeetline apps"> (the nine dots) </summary>
 *       <div class="suite-panel suite-panel--apps"> (the .suite-apps grid, then .suite-links) </div>
 *     </details>
 *     <a class="suite-signin" href="https://chat.example.com/">Sign in</a>
 *   </div>
 *
 * A <details> opens and closes with no script, so the apps grid is the same panel there as everywhere. The gear is not drawn
 * on the landing: a theme choice needs a place to keep it and the apex origin keeps nothing (the page follows
 * prefers-color-scheme), so a gear there would be a control that does nothing.
 *
 * No style attribute anywhere (style-src has no 'unsafe-inline'), no @import, no font, no image: the icons are SVG nodes built by
 * the script. BEM, with the block names prefixed suite-. Sizes are the mockups': 44 px buttons (a finger), a 40 px avatar, panels
 * of 344 and 372 px, and under 600 px the quick settings become a bottom sheet and the other panels fill the width. */

/* The six apps' glyph colors. They are a brand-ish hue per app, so they are tokens of their own rather than the theme's three
 * accents; the pairs are measured to read at 3:1 as a glyph on the tile's tint on each side. The light values are keyed to
 * data-scheme (the attribute web/themes.js sets for every theme, an operator's own included); the landing, which has none,
 * sets the same names under prefers-color-scheme in landing.css. */
:root {
  --suite-chat: #7cbcff;
  --suite-mail: #c3a4ff;
  --suite-search: #6fe3c1;
  --suite-docs: #ffd16a;
  --suite-status: #ff9aa8;
  --suite-admin: #b9c8ee;
  --suite-bar-h: 56px;
  --suite-z: 400;
}
:root[data-scheme="light"] {
  --suite-chat: #1d5fb0;
  --suite-mail: #6b3fc4;
  --suite-search: #0c6e52;
  --suite-docs: #8a5a00;
  --suite-status: #b02a45;
  --suite-admin: #3d4d73;
}

.suite-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.35;
}
.suite-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.suite-cluster :focus-visible {
  outline: var(--ring-w, 2px) solid var(--ring, var(--amber));
  outline-offset: var(--ring-gap, 2px);
}

/* ── the buttons ── */
.suite-slot { position: relative; }
/* A slot never shrinks under a narrow bar: the buttons keep their 44 px and the page's own title gives way. */
.suite-slot--bell, .suite-slot--apps, .suite-slot--gear, .suite-slot--account { flex: none; }
.suite-btn, .suite-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  list-style: none;
}
.suite-btn::-webkit-details-marker { display: none; }
.suite-btn:hover, .suite-avatar:hover { background: var(--surface-hover, color-mix(in srgb, var(--text) 6%, transparent)); }
.suite-btn--open, .suite-btn--open:hover, details[open] > .suite-btn {
  background: var(--surface-active, color-mix(in srgb, var(--text) 11%, transparent));
}
.suite-avatar {
  width: 40px;
  height: 40px;
  margin-left: 4px;
  border: 2px solid transparent;
  background: var(--own, var(--slab-2));
  color: var(--text);
  font-size: 0.93rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.suite-avatar.suite-btn--open { border-color: var(--amber); background: var(--own, var(--slab-2)); }
.suite-btn--bell { overflow: visible; }
.suite-badge {
  position: absolute;
  top: 6px;
  right: 5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--alarm);
  color: var(--ink-alarm, #fff);
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.suite-badge[hidden] { display: none; }
.suite-signin {
  display: inline-flex;
  align-items: center;
  height: 40px;
  margin-left: 6px;
  padding: 0 22px;
  border-radius: 20px;
  background: var(--amber);
  color: var(--ink, #17130a);
  font-size: 1rem;
  font-weight: 650;
  text-decoration: none;
}
.suite-signin:hover { filter: brightness(1.06); }

/* ── the panels ── */
.suite-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: var(--suite-z);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - var(--suite-bar-h) - 16px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 24px;
  background: var(--slab);
  color: var(--text);
  box-shadow: var(--shadow-3, 0 18px 50px rgba(0, 0, 0, 0.55));
}
.suite-panel[hidden] { display: none; }
.suite-panel--apps { width: 344px; }
.suite-panel--gear { width: 372px; gap: 16px; padding: 20px 20px 16px; }
.suite-panel--account { width: 372px; right: -6px; gap: 6px; padding: 22px 22px 18px; border-radius: 28px; }
.suite-panel--bell { width: 330px; gap: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .suite-panel { animation: suite-pop var(--dur-2, 0.18s) var(--ease-out, ease-out); }
}
@keyframes suite-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.suite-title { font-size: 1.13rem; font-weight: 650; }
.suite-eyebrow {
  color: var(--muted-text, var(--muted));
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.suite-note { color: var(--muted-text, var(--muted)); font-size: 0.8rem; text-align: center; }
.suite-empty { margin: 4px 0; color: var(--muted-text, var(--muted)); font-size: 0.93rem; }

/* ── the apps grid ── */
.suite-apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.suite-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 92px;
  padding: 6px 2px;
  border-radius: 14px;
  color: var(--text);
  font-size: 0.9rem;
  text-align: center;
  text-decoration: none;
}
a.suite-app:hover { background: var(--surface-hover, color-mix(in srgb, var(--text) 6%, transparent)); }
.suite-app[aria-current="page"] { background: var(--surface-active, color-mix(in srgb, var(--text) 11%, transparent)); }
.suite-app__label { max-width: 100%; overflow-wrap: anywhere; }
.suite-app__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--suite-glyph, var(--text)) 16%, var(--slab));
  color: var(--suite-glyph, var(--text));
}
.suite-app--chat { --suite-glyph: var(--suite-chat); }
.suite-app--mail { --suite-glyph: var(--suite-mail); }
.suite-app--search { --suite-glyph: var(--suite-search); }
.suite-app--docs { --suite-glyph: var(--suite-docs); }
.suite-app--status { --suite-glyph: var(--suite-status); }
.suite-app--admin { --suite-glyph: var(--suite-admin); }
.suite-app--soon { opacity: 0.65; cursor: default; }
.suite-app__note { color: var(--muted-text, var(--muted)); font-size: 0.73rem; line-height: 1.2; }

/* ── links and rows ── */
.suite-links { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line-soft, var(--line)); }
.suite-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.97rem;
  text-decoration: none;
  cursor: pointer;
}
.suite-link:hover { background: var(--surface-hover, color-mix(in srgb, var(--text) 6%, transparent)); }
.suite-link__more { color: var(--muted-text, var(--muted)); }
.suite-link--button { justify-content: center; color: var(--amber-text, var(--amber)); }
.suite-list { margin: 0; padding: 0; list-style: none; }
.suite-list__item { margin: 0; padding: 0; }
.suite-link--row { width: 100%; box-sizing: border-box; }

.suite-section { display: flex; flex-direction: column; gap: 8px; }
.suite-section--ruled { gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft, var(--line)); }
.suite-seg {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-sunk, var(--void));
}
.suite-seg__btn {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted-text, var(--muted));
  font: inherit;
  font-size: 0.93rem;
  cursor: pointer;
}
.suite-seg__btn:hover { background: var(--surface-hover, color-mix(in srgb, var(--text) 6%, transparent)); }
.suite-seg__btn[aria-pressed="true"] {
  background: var(--accent-soft, color-mix(in srgb, var(--amber) 13%, transparent));
  box-shadow: inset 0 0 0 1px var(--accent-line, var(--amber));
  color: var(--text);
  font-weight: 650;
}
.suite-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.suite-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.suite-row__name { font-size: 1rem; }
.suite-row__hint { color: var(--muted-text, var(--muted)); font-size: 0.83rem; }
.suite-row__error { color: var(--alarm-text, var(--alarm)); font-size: 0.83rem; }
.suite-switch {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: var(--line-strong, var(--line));
  cursor: pointer;
}
.suite-switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
}
.suite-switch[aria-checked="true"] { background: var(--amber); }
.suite-switch[aria-checked="true"] .suite-switch__knob { transform: translateX(20px); background: var(--ink, #17130a); }
@media (prefers-reduced-motion: no-preference) {
  .suite-switch, .suite-switch__knob { transition: transform var(--dur-1, 0.12s), background var(--dur-1, 0.12s); }
}
.suite-select {
  flex-shrink: 0;
  height: 32px;
  max-width: 150px;
  padding: 0 10px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}
.suite-select option { background: var(--slab); color: var(--text); }

.suite-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border: 0;
  border-radius: 21px;
  background: var(--surface-active, color-mix(in srgb, var(--text) 11%, transparent));
  color: var(--text);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.suite-cta:hover { background: var(--accent-soft, color-mix(in srgb, var(--amber) 13%, transparent)); }

/* ── the account card ── */
.suite-account { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.suite-account__address { align-self: stretch; color: var(--muted-text, var(--muted)); font-size: 0.87rem; text-align: center; overflow-wrap: anywhere; }
.suite-account__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin-top: 10px;
  border: 3px solid var(--amber);
  border-radius: 50%;
  background: var(--own, var(--slab-2));
  font-size: 2rem;
  font-weight: 700;
}
.suite-account__hi { margin-top: 8px; font-size: 1.47rem; font-weight: 650; overflow-wrap: anywhere; text-align: center; }
.suite-pill {
  display: inline-flex;
  align-items: center;
  height: 40px;
  margin-top: 8px;
  padding: 0 20px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 20px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.97rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.suite-pill:hover { background: var(--surface-hover, color-mix(in srgb, var(--text) 6%, transparent)); }
/* The account's plan and its pool (0.2.28): the bar is a <progress>, so its length is the browser's and no style is set by script.
 * Its color says the level and so does the text under it, so the bar is never the only carrier of a warning. */
.suite-plan { align-self: stretch; display: flex; flex-direction: column; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft, var(--line)); }
.suite-plan__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.suite-plan__name { font-size: 1.07rem; font-weight: 650; }
.suite-plan__price { color: var(--muted-text, var(--muted)); font-size: 0.85rem; }
.suite-pool {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-sunk, var(--void));
  color: var(--mint);
}
/* One rule per engine: a selector list that names a pseudo-element the engine does not know is dropped whole. */
.suite-pool::-webkit-progress-bar { background: transparent; }
.suite-pool::-webkit-progress-value { background: var(--mint); border-radius: 3px; }
.suite-pool::-moz-progress-bar { background: var(--mint); border-radius: 3px; }
.suite-pool--warn::-webkit-progress-value { background: var(--amber); }
.suite-pool--warn::-moz-progress-bar { background: var(--amber); }
.suite-pool--full::-webkit-progress-value { background: var(--alarm); }
.suite-pool--full::-moz-progress-bar { background: var(--alarm); }
.suite-pool__line { font-size: 0.92rem; font-weight: 600; }
.suite-pool__parts, .suite-plan__hint { color: var(--muted-text, var(--muted)); font-size: 0.82rem; }
.suite-plan__note { padding: 8px 10px; border-radius: 8px; font-size: 0.86rem; background: color-mix(in srgb, var(--amber) 14%, transparent); }
.suite-plan__note--full { background: color-mix(in srgb, var(--alarm) 16%, transparent); }
.suite-plan__offer { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 4px; }
.suite-pill--plan { margin-top: 0; }
.suite-plan__year { color: var(--amber-text, var(--amber)); font-size: 0.86rem; }
.suite-plan__soon { font-size: 0.92rem; font-weight: 600; }
.suite-account__apps { align-self: stretch; display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft, var(--line)); }
.suite-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.suite-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-sunk, var(--void));
  font-size: 0.9rem;
}
.suite-chip__label { white-space: nowrap; }
.suite-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.suite-signout {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  gap: 10px;
  height: 44px;
  margin-top: 16px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 22px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.suite-signout__label { min-width: 0; }
.suite-signout:hover { background: var(--surface-hover, color-mix(in srgb, var(--text) 6%, transparent)); }
.suite-account__foot { margin-top: 12px; color: var(--muted-text, var(--muted)); font-size: 0.8rem; }
.suite-foot__link { color: inherit; text-decoration: none; }
.suite-foot__link:hover { text-decoration: underline; }

/* ── the sheet's own parts: only a phone shows them ── */
.suite-sheet__head { display: contents; }
.suite-sheet__grip, .suite-sheet__close, .suite-scrim { display: none; }
.suite-sheet__title { display: flex; align-items: center; justify-content: space-between; }

/* ── a phone ── */
@media (max-width: 600px) {
  .suite-slot { position: static; }
  .suite-panel, .suite-panel--gear, .suite-panel--account, .suite-panel--bell {
    position: fixed;
    top: var(--suite-bar-h);
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
  }
  /* Quick settings are a bottom sheet (the mockup's phone screen): grip, title with a 44 px close, then the sections. */
  .suite-panel--gear {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(92vh, 700px);
    padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    border-width: 1px 0 0;
    border-radius: 26px 26px 0 0;
    box-shadow: var(--shadow-3, 0 -14px 40px rgba(0, 0, 0, 0.5));
  }
  .suite-sheet__head { display: flex; flex-direction: column; gap: 14px; }
  .suite-sheet__grip { display: block; align-self: center; width: 42px; height: 5px; border-radius: 3px; background: var(--line-strong, var(--line)); }
  .suite-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -8px -10px -8px 0;
    border: 0;
    background: transparent;
    color: var(--muted-text, var(--muted));
    font: inherit;
    font-size: 1.5rem;
    cursor: pointer;
  }
  .suite-scrim { position: fixed; inset: 0; z-index: calc(var(--suite-z) - 1); display: block; background: rgb(0 0 0 / 0.4); }
  .suite-scrim[hidden] { display: none; }
  .suite-seg__btn { height: 44px; font-size: 1rem; }
  .suite-select { height: 44px; max-width: 160px; }
  .suite-link { min-height: 48px; font-size: 1.07rem; }
  .suite-cta { height: 48px; border-radius: 24px; background: var(--amber); color: var(--ink, #17130a); font-weight: 700; }
}
@media (max-width: 380px) {
  .suite-cluster { gap: 0; }
  .suite-signin { padding: 0 16px; }
}
