/* =====================================================================
   SETTINGS (assets/settings.js) and the account menu under the avatar.
   Drawn on the Money tokens, so the clean shell (clean.css), dark mode and
   the agent's brand colour (themes.js) all reach it without help.
   ===================================================================== */

/* ---- the account menu (desktop; phones use the More sheet) ---- */
.ag-right { position: relative; }
.ag-menu, .ag-menu-scrim { display: none; }
@media (min-width: 701px) {
  .ag-menu-scrim { display: block; position: fixed; inset: 0; z-index: 60; }
  .ag-menu { display: block; position: absolute; right: 0; top: calc(100% + 10px); z-index: 61; width: 236px; padding: 6px;
    background: #fff; color: #171b21; border: 1px solid #e4e7ea; border-radius: 12px; box-shadow: 0 12px 32px rgba(13, 19, 27, .16); }
  .ag-menu-who { padding: 10px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid #eef0f2; display: grid; gap: 2px; }
  .ag-menu-who b { font-size: 13.5px; font-weight: 600; }
  .ag-menu-who span { font-size: 12px; color: #5c6672; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ag-menu .ag-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent;
    color: #171b21; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; text-decoration: none; }
  .ag-menu .ag-menu-item:hover, .ag-menu .ag-menu-item.on { background: #f0f2f4; color: #171b21; }
  .ag-menu .ag-menu-item svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: #5c6672; flex-shrink: 0; }
  .ag-bar[data-theme="dark"] .ag-menu { background: #151b23; color: #e9edf2; border-color: #27303a; }
  .ag-bar[data-theme="dark"] .ag-menu-who { border-bottom-color: #1f2730; }
  .ag-bar[data-theme="dark"] .ag-menu-who span, .ag-bar[data-theme="dark"] .ag-menu .ag-menu-item svg.i { color: #a3adb9; }
  .ag-bar[data-theme="dark"] .ag-menu .ag-menu-item { color: #e9edf2; }
  .ag-bar[data-theme="dark"] .ag-menu .ag-menu-item:hover, .ag-bar[data-theme="dark"] .ag-menu .ag-menu-item.on { background: #1c232c; color: #e9edf2; }
  .ag-avatar { cursor: pointer; }
  /* The bar paints its links pale; the menu is a white card and wins. */
  html .ag-bar.ag-clean .ag-right .ag-menu a.ag-menu-item, html .ag-bar.ag-clean .ag-right .ag-menu a.ag-menu-item:hover { color: #171b21; text-decoration: none; }
  html .ag-bar.ag-clean[data-theme="dark"] .ag-right .ag-menu a.ag-menu-item, html .ag-bar.ag-clean[data-theme="dark"] .ag-right .ag-menu a.ag-menu-item:hover { color: #e9edf2; }
}

/* A brand other than navy: the bar's quiet text is cut from white, so it
   reads on any of the ten colours. */
@media (min-width: 701px) {
  html[data-brand] .ag-bar.ag-clean:not([data-theme="dark"]) .ag-tab,
  html[data-brand] .ag-bar.ag-clean:not([data-theme="dark"]) .ag-right > a { color: rgba(255, 255, 255, .68); }
  html[data-brand] .ag-bar.ag-clean:not([data-theme="dark"]) .ag-tab:hover,
  html[data-brand] .ag-bar.ag-clean:not([data-theme="dark"]) .ag-tab.active,
  html[data-brand] .ag-bar.ag-clean:not([data-theme="dark"]) .ag-right > a:hover { color: #fff; }
  html[data-brand] .ag-bar.ag-clean:not([data-theme="dark"]) .ag-tab .tp-count { color: rgba(255, 255, 255, .68); }
}

/* ---- an agent's logo, in every top bar (assets/themes.js brandHtml) ---- */
.pt-logo { display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 3px 8px; border-radius: 7px; background: #fff; box-sizing: border-box; flex-shrink: 0; }
.pt-logo img { display: block; height: 100%; width: auto; max-width: 150px; object-fit: contain; }
.cx-bar .pt-logo, .og-topbar .pt-logo { padding-left: 0; }
.st-logo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.st-logo label.m-btn { cursor: pointer; }
.pt-logo.st-logo-big { height: 56px; padding: 8px 14px; border: 1px solid var(--m-line); }
.pt-logo.st-logo-big img { max-width: 260px; }
.st-logo-none { display: inline-flex; align-items: center; height: 56px; padding: 0 18px; border: 1px dashed var(--m-line); border-radius: 8px; color: var(--m-faint); font-size: 12.5px; }

/* ---- the page ---- */
.st-main { max-width: 1180px; }
.st-hubhead { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.st-hubhead .m-title { margin: 0; }
.st-search { display: flex; align-items: center; gap: 8px; flex: 0 1 320px; padding: 0 12px; height: 38px; background: var(--m-surface); border: 1px solid var(--m-line); border-radius: 9px; color: var(--m-faint); }
.st-search:focus-within { border-color: var(--m-accent); box-shadow: 0 0 0 3px var(--m-accent-soft); }
.st-search svg.i { width: 16px; height: 16px; flex-shrink: 0; }
.st-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--m-ink); font: inherit; font-size: 13.5px; }

.st-grid { columns: 4 230px; column-gap: 14px; }
.st-card { break-inside: avoid; margin: 0 0 14px; background: var(--m-surface); border: 1px solid var(--m-line); border-radius: 12px; padding: 18px 18px 12px; }
.st-card h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--m-ink); }
.st-card h2 svg.i { width: 17px; height: 17px; color: var(--m-accent); flex-shrink: 0; }
.st-card h2 em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 500; color: var(--m-faint); }
.st-card ul { list-style: none; margin: 0; padding: 0 0 0 26px; }
.st-card li a { display: block; padding: 6px 0; font-size: 13.5px; color: var(--m-muted); text-decoration: none; }
.st-card li a:hover { color: var(--m-accent); text-decoration: underline; }
.st-none { padding: 40px 0; text-align: center; color: var(--m-faint); font-size: 13.5px; }
.st-card[hidden], .st-card li[hidden], .st-none[hidden] { display: none; }

.st-lead { margin: -6px 0 18px; max-width: 640px; color: var(--m-muted); font-size: 13.5px; line-height: 1.55; }
.st-main .m-card { margin-bottom: 14px; }

.st-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.st-swatch { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: var(--m-surface); border: 1px solid var(--m-line); border-radius: 10px; color: var(--m-ink); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.st-swatch:hover { border-color: var(--m-faint); }
.st-swatch.on { border-color: var(--m-accent); box-shadow: 0 0 0 2px var(--m-accent-soft); }
.st-swatch b { font-weight: 500; flex: 1; }
.st-swatch svg.i { width: 15px; height: 15px; color: var(--m-accent); }
.st-chip { position: relative; width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; overflow: hidden; }
.st-chip i { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-top-left-radius: 8px; }

.st-fields { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 12px; }
.st-fields .m-field { min-width: 0; }
.st-fields input { width: 100%; min-width: 0; box-sizing: border-box; }

.st-sample { border: 1px solid var(--m-line); border-radius: 10px; overflow: hidden; background: #fff; }
.st-sample-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: #fff; font-size: 12px; }
.st-sample-bar b { font-size: 13px; font-weight: 600; margin-right: 6px; }
.st-sample-bar i { font-style: normal; color: rgba(255, 255, 255, .68); padding: 3px 8px; border-radius: 6px; }
.st-sample-bar i.on { background: rgba(255, 255, 255, .15); color: #fff; font-weight: 600; }
.st-sample-mark { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 16px; padding: 0 3px; border-radius: 5px; background: #fff; font-size: 10px; font-weight: 700; }
.st-sample-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px; font-size: 12px; }
.st-sample-pill, .st-sample-btn { color: #fff; padding: 6px 11px; border-radius: 8px; font-weight: 600; }
.st-sample-row { padding: 6px 11px; border-radius: 8px; font-weight: 500; }

.st-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.st-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 28px; }
.st-app { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--m-line-soft); font-size: 13.5px; color: var(--m-ink); }

.st-kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--m-line-soft); font-size: 13.5px; }
.st-kv:last-child { border-bottom: 0; }
.st-kv span { color: var(--m-muted); }
.st-kv b { font-weight: 500; color: var(--m-ink); text-align: right; overflow-wrap: anywhere; }

.st-notify { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--m-line-soft); }
.st-notify:last-child { border-bottom: 0; }
.st-notify .t { display: grid; gap: 2px; min-width: 0; }
.st-notify .t b { font-size: 13.5px; font-weight: 500; color: var(--m-ink); }
.st-notify .t span { font-size: 12.5px; color: var(--m-muted); }
.st-note { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 14px; padding: 11px 13px; border-radius: 10px; background: var(--m-warn-soft); color: var(--m-ink); font-size: 13px; line-height: 1.45; max-width: 720px; }
.st-note svg.i { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--m-warn); }

/* A client's or partner's page sits inside their own shell (.cx-main). */
.money-app.st-guest { display: block; min-height: 0; background: transparent; max-width: 720px; margin: 0 auto; padding: 8px 0 60px; }
.st-h2 { margin: 26px 0 10px; font-size: 14px; font-weight: 600; color: var(--m-ink); }
.cx-bar a.ag-avatar { text-decoration: none; cursor: pointer; }

@media (max-width: 700px) {
  .st-app-shell { display: block; }
  .st-app-shell > .m-side { display: flex; flex-direction: row; gap: 6px; overflow-x: auto; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--m-line); }
  .st-app-shell > .m-side .m-brand, .st-app-shell > .m-side .m-navlabel { display: none; }
  .st-app-shell > .m-side .m-nav { white-space: nowrap; flex-shrink: 0; }
  .st-main { padding: 18px 16px 96px; }
  .st-fields { grid-template-columns: 1fr; }
}

/* Account: your details */
.st-profile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 14px; }
.st-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--m-muted); }
.st-field .m-input { width: 100%; }
@media (max-width: 700px) { .st-profile { grid-template-columns: 1fr; } }
