/*
 * accounts.css - the account pages: network, profile, profile settings, messages, organizations, admin.
 * Built on css/adspot-ui.css (--ui-* tokens, .ui-card, .ui-btn, .ui-badge ...). Only what the kit does not cover lives here.
 * Sections: shell, icons, skeletons, people, profile, settings, messages, organizations, admin, responsive.
 */

/* ------------------------------------------------------------------ shell */
.acc-page [hidden] { display: none !important; }
.acc-page > .ui-card + .ui-card, .acc-block + .acc-block { margin-top: var(--ui-s3); }
.acc-block { padding-bottom: 22px; }
.acc-search { flex: 1 1 320px; max-width: 460px; }
.ui-pagehead__actions .acc-search { flex: 0 1 400px; width: 400px; max-width: 100%; }
.acc-people > .ui-empty, .acc-spots > .ui-empty { grid-column: 1 / -1; }
.acc-two { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: var(--ui-s3); align-items: start; margin-top: var(--ui-s3); }
.acc-two > .ui-card + .ui-card { margin-top: 0; }
.acc-page .ui-empty { padding: 40px 24px; }
.acc-page .ui-note { margin: 12px 0 0; }
.ui-modal__dialog > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.ui-modal__foot:empty { display: none; }

/* Firefox shrinks the whole page through the old home.css transform on html and body; the new pages are sized for 100% */
html, body { -moz-transform: none !important; transform: none !important; }

/* file pickers */
.acc-page input[type="file"].ui-input, .ui-modal input[type="file"].ui-input { padding: 7px 10px; font-size: 14px; color: var(--ui-muted); height: auto; }
.ui-modal input[type="file"]::file-selector-button { margin-right: 12px; padding: 6px 12px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-xs); background: #fff; color: var(--ui-ink); font: inherit; font-weight: 600; cursor: pointer; }
.ui-modal input[type="file"]::file-selector-button:hover { background: var(--ui-tint); }

/* ------------------------------------------------------------------ icons */
.acc-ico { display: inline-block; width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.acc-ico--xs { width: 13px; height: 13px; vertical-align: -2px; }
.ui-btn .acc-ico { margin: 0 2px 0 -2px; }
.ui-empty__icon .acc-ico, .ui-empty__icon svg { width: 26px; height: 26px; }

/* ------------------------------------------------------------------ skeletons (same height as what replaces them) */
.acc-skel { border-radius: var(--ui-radius); }
.acc-skel--row { height: 56px; margin-bottom: 8px; }
.acc-skel--person { height: 92px; }
.acc-skel--stat { height: 78px; }
.msg-skel { padding: 8px 0; }

/* ------------------------------------------------------------------ avatars */
.acc-av { background: var(--ui-sage-soft); }
.acc-av--sm { width: 28px; height: 28px; }
.acc-av--md { width: 44px; height: 44px; }
.acc-av--lg { width: 56px; height: 56px; }
.acc-av--xl { width: 112px; height: 112px; box-shadow: 0 0 0 4px #fff, var(--ui-shadow); }

/* ------------------------------------------------------------------ people (network, profile) */
.acc-people { display: grid; gap: var(--ui-s3); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.acc-block > .acc-people { margin-top: 4px; }
.acc-person { display: flex; align-items: flex-start; gap: 14px; padding: 16px; min-width: 0; box-shadow: var(--ui-shadow-sm); }
.acc-person__body { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.acc-person__name { font-weight: 700; font-size: 15px; color: var(--ui-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-person__company { font-size: 14px; color: var(--ui-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-person__status { font-size: 14px; color: var(--ui-text); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.acc-person__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
#search_results_container .ui-card__head, .acc-block > .ui-card__head { margin-bottom: 18px; }

/* ------------------------------------------------------------------ profile */
.prof-hero { padding: 0; overflow: hidden; margin-bottom: var(--ui-s3); }
.prof-cover { height: 140px; background: linear-gradient(135deg, var(--ui-sage-soft) 0%, #d3dfd0 55%, var(--ui-sage-line) 100%); }
.prof-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding: 0 24px 22px; margin-top: -48px; }
.prof-pic { position: relative; }
.prof-id { flex: 1 1 280px; min-width: 0; padding-top: 60px; }
.prof-name { margin: 0; font-family: var(--ui-font-head); font-weight: var(--ui-head-weight); font-size: clamp(24px, 2.4vw, 30px); letter-spacing: var(--ui-head-track); line-height: 1.2; color: var(--ui-ink); overflow-wrap: anywhere; }
.prof-company { margin: 2px 0 0; font-size: 15px; color: var(--ui-muted); }
.prof-company:empty, .prof-status:empty, .prof-flags:empty, .prof-actions:empty { display: none; }
.prof-status { margin: 10px 0 0; max-width: 62ch; font-size: 14px; line-height: 1.5; color: var(--ui-text); overflow-wrap: anywhere; }
.prof-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.prof-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 60px; }
.prof-skel-name { display: block; width: 260px; max-width: 80%; height: 32px; }
.prof-overview { margin-bottom: var(--ui-s3); }
.prof-overview .ui-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
#profile_page_container .ui-section { margin-top: var(--ui-s4); }
.acc-spots { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.acc-spot, .ui-card.acc-spot { padding: 0; text-decoration: none; color: inherit; transition: box-shadow var(--ui-ease), transform var(--ui-ease), border-color var(--ui-ease); }
.acc-spot:hover { box-shadow: var(--ui-shadow-md); transform: translateY(-2px); border-color: var(--ui-sage-line); }
/* the frame is always 16:9; the picture inside decides how it fits (photo: fill, logo: whole, on a soft background) */
.acc-spot__media { flex: none; background: linear-gradient(135deg, #f1f4ef 0%, #e4eadf 100%); }
.acc-spot__media > .acc-spot__ph { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #8d9a89; font-size: 13px; font-weight: 600; background: linear-gradient(135deg, #f1f4ef 0%, #e0e7dc 100%); }
.acc-spot__media.is-empty > .acc-spot__ph { display: flex; }
.acc-spot__media.is-empty { background-image: none; }
.acc-spot__img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.acc-spot__img.is-logo { object-fit: contain; padding: 12% 14%; box-sizing: border-box; background: transparent; }
.acc-spot__img.is-photo { object-fit: cover; }
.acc-spot .ui-card__body { gap: 8px; }
.acc-spot .ui-card__name { font-size: 16px; }
.acc-spot__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; font-size: 14px; color: var(--ui-ink); }
.acc-spot__price strong { font-family: var(--ui-font-head); font-weight: var(--ui-head-weight); font-size: 22px; line-height: 1.15; letter-spacing: var(--ui-head-track); }
.acc-spot__price .ui-muted { font-size: 14px; }
.acc-spot__facts { gap: 2px 14px; min-height: 22px; }
.acc-spot__loc { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.acc-spot__loc > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-spot__cats { flex-wrap: nowrap; justify-content: flex-start; gap: 6px; min-height: 46px; overflow: hidden; }
.acc-spot__cats .ui-cat { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-spot.is-locked { cursor: pointer; }
.acc-spot.is-locked .ui-media::after { content: ""; position: absolute; inset: 0; background: rgba(245, 246, 244, .55); }
.acc-spot.is-locked .ui-card__badges { z-index: 1; }

/* ------------------------------------------------------------------ settings */
.set-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--ui-s3); align-items: start; }
.set-profile .ui-form-actions { margin-top: 4px; }
.set-pic { display: flex; align-items: center; gap: 20px; margin: 0 0 20px; padding-bottom: 20px; border-bottom: 1px solid var(--ui-line); }
.set-pic__canvas { width: 104px; height: 104px; flex: none; border-radius: 50%; object-fit: cover; background: var(--ui-sage-soft); box-shadow: 0 0 0 3px #fff, var(--ui-shadow); }
.set-pic__text { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.set-lead { margin: 0 0 14px; font-size: 14px; line-height: 1.5; }
.set-fauth { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--ui-line); }
.set-fauth__qr { width: 150px; height: 150px; flex: none; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); background: #fff; padding: 6px; box-sizing: border-box; }
.set-fauth__form { flex: 1 1 220px; min-width: 0; }
.set-servers { display: grid; gap: 8px; }
.set-servers .ui-empty { padding: 24px 12px; }
.set-server { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); background: var(--ui-tint); min-width: 0; }
.set-server__ico { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; background: #fff; color: var(--ui-sage-dark); }
.set-server__name { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--ui-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-tokens { margin: 0; }
.set-tokens .ui-stat__value { font-size: 32px; }
.srv-mode { margin-bottom: 16px; }
.srv-google { display: flex; justify-content: center; min-height: 44px; padding: 8px 0; }

/* ------------------------------------------------------------------ messages: two panes */
.msg-folders { margin-bottom: var(--ui-s3); }
.msg-shell {
    display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    padding: 0; overflow: hidden;
    height: clamp(520px, calc(100vh - 270px), 820px);
}
.msg-list-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--ui-line); background: #fff; }
.msg-tools { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 8px; padding: 12px; border-bottom: 1px solid var(--ui-line); }
.msg-tools .ui-search { max-width: none; min-width: 0; }
.msg-tools .ui-select { width: 100%; padding-left: 10px; padding-right: 26px; font-size: 14px; }
.msg-list-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.msg-list { display: block; }
.msg-list .ui-skel-row:last-child { border-bottom: 0; }
.msg-list .ui-empty { padding: 40px 20px; }
.msg-list .ui-more { margin: 0; padding: 12px; }

.msg-row {
    appearance: none; position: relative; display: flex; align-items: flex-start; gap: 10px; width: 100%; box-sizing: border-box;
    padding: 14px 16px 14px 18px; border: 0; border-bottom: 1px solid var(--ui-line); border-left: 3px solid transparent;
    background: #fff; color: var(--ui-text); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--ui-ease);
}
.msg-row:hover { background: #f8f9f7; }
.msg-row:focus-visible { outline: 2px solid var(--ui-sage); outline-offset: -2px; }
.msg-row.is-selected { background: var(--ui-sage-soft); border-left-color: var(--ui-sage); }
.msg-row__main { display: grid; gap: 3px; min-width: 0; flex: 1 1 auto; }
.msg-row__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.msg-row__who { font-size: 14px; color: var(--ui-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row__date { flex: none; font-size: 14px; color: var(--ui-muted); }
.msg-row__title { font-size: 14px; font-weight: 600; color: var(--ui-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row__text { font-size: 14px; color: var(--ui-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.msg-row__count { font-size: 13px; color: var(--ui-muted); }
.msg-row.is-unread .msg-row__who { font-weight: 700; }
.msg-row:not(.is-unread) .msg-row__who { font-weight: 500; }
.msg-dot { width: 10px; height: 10px; flex: none; margin-top: 5px; border-radius: 50%; background: var(--ui-sage); box-shadow: 0 0 0 3px var(--ui-sage-soft); }

/* thread */
.msg-thread-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; }
.msg-thread { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.msg-thread > .ui-empty { margin: auto; }
.msg-thread__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; flex: none; padding: 14px 20px; border-bottom: 1px solid var(--ui-line); }
.msg-thread__title { flex: 1 1 220px; min-width: 0; }
.msg-thread__title h2 { margin: 0; font-family: var(--ui-font-head); font-weight: var(--ui-head-weight); font-size: 19px; letter-spacing: var(--ui-head-track); line-height: 1.3; color: var(--ui-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-thread__with { margin: 3px 0 0; font-size: 14px; color: var(--ui-muted); }
.msg-thread__with .ui-badge { vertical-align: 1px; margin-right: 4px; }
.msg-thread__tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex: 0 1 auto; }
.msg-thread__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px; display: flex; flex-direction: column; gap: 16px; background: #fafbf9; }
.msg-back { display: none; margin-right: -4px; }
.msg-note { margin: 0; }
.msg-none { margin: 0; text-align: center; padding: 24px 0; }

/* the request card with Approve and Deny */
.msg-request { padding: 18px 20px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: #fff; box-shadow: var(--ui-shadow-sm); }
.msg-request.is-decision { border-color: var(--ui-sage-line); border-left: 4px solid var(--ui-sage); background: #fff; }
.msg-request__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.msg-request__title { margin: 0; font-size: 16px; font-weight: 700; color: var(--ui-ink); }
.msg-request__head a { font-size: 14px; color: var(--ui-sage-dark); font-weight: 600; }
.msg-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 20px; margin: 0; }
.msg-fact { display: grid; gap: 2px; min-width: 0; }
.msg-fact dt { font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ui-muted); }
.msg-fact dd { margin: 0; font-size: 14px; color: var(--ui-ink); overflow-wrap: anywhere; }
.msg-facts--modal { grid-template-columns: 1fr 1fr; margin-bottom: 12px; padding: 14px; border-radius: var(--ui-radius-sm); background: var(--ui-tint); }
.msg-request__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--ui-line); }
.msg-request__wait { margin: 14px 0 0; font-size: 14px; color: var(--ui-muted); }
.msg-request__head + .msg-request__wait { margin-top: 0; }
.msg-denied { color: var(--ui-bad); }

/* conversation bubbles */
.msg-bubbles { display: flex; flex-direction: column; gap: 12px; }
.thread_message { align-self: flex-start; max-width: min(640px, 88%); padding: 10px 14px; border: 1px solid var(--ui-line); border-radius: 14px 14px 14px 4px; background: #fff; box-shadow: var(--ui-shadow-sm); }
.thread_message.is-mine { align-self: flex-end; border-color: var(--ui-sage-line); border-radius: 14px 14px 4px 14px; background: var(--ui-sage-soft); }
.thread_message__meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 4px; font-size: 14px; color: var(--ui-muted); }
.thread_message__meta strong { color: var(--ui-ink); font-weight: 700; }
.thread_message__text { font-size: 14px; line-height: 1.55; color: var(--ui-text); overflow-wrap: anywhere; }
.thread_message__text p { margin: 0 0 6px; }
.thread_message__text a { color: var(--ui-sage-dark); font-weight: 600; }

/* reply box */
.msg-compose { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--ui-line); background: #fff; }
.msg-compose[hidden] { display: none; }
.msg-compose .ui-textarea { grid-column: 2; grid-row: 1; height: 44px; min-height: 44px; max-height: 160px; resize: vertical; }
.msg-compose__bar { display: contents; }
.msg-compose__bar .ui-grow { display: none; }
.msg-attach { grid-column: 1; grid-row: 1; cursor: pointer; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-attach span { overflow: hidden; text-overflow: ellipsis; }
.msg-compose__bar .ui-btn[type="submit"] { grid-column: 3; grid-row: 1; }

a.tandc { color: var(--ui-sage-dark); font-weight: 600; text-decoration: none; }
a.tandc:hover { text-decoration: underline; }

/* deny reasons */
.msg-reasons { display: grid; gap: 8px; }
.msg-reason { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); background: #fff; cursor: pointer; }
.msg-reason:hover { background: var(--ui-tint); }

/* ------------------------------------------------------------------ organizations */
.org-layout { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: var(--ui-s3); align-items: start; }
.org-side { padding-bottom: 8px; position: sticky; top: calc(var(--ui-toolbar-h, 61px) + 16px); }
.org-list { display: grid; gap: 4px; margin: 0 -8px; }
.org-item {
    appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 10px 12px;
    border: 1px solid transparent; border-radius: var(--ui-radius-sm); background: transparent; color: var(--ui-text); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--ui-ease), border-color var(--ui-ease);
}
.org-item:hover { background: var(--ui-tint); }
.org-item:focus-visible { outline: 2px solid var(--ui-sage); outline-offset: 1px; }
.org-item.active { background: var(--ui-sage-soft); border-color: var(--ui-sage-line); }
.org-item__logo { width: 36px; height: 36px; flex: none; border-radius: 8px; object-fit: cover; background: var(--ui-tint); border: 1px solid var(--ui-line); }
.org-item__text { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
.org-item__name { font-weight: 700; font-size: 14px; line-height: 1.3; color: var(--ui-ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.org-item__div { min-width: 0; font-size: 14px; color: var(--ui-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-item__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; margin-top: 2px; }
.org-item__meta .ui-badge { flex: none; }
.org-list .ui-empty { padding: 28px 12px; }
.org-main { display: grid; gap: var(--ui-s3); min-width: 0; }
.org-detail { display: grid; gap: var(--ui-s3); min-width: 0; }
.org-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.org-logo { width: 64px; height: 64px; flex: none; border-radius: var(--ui-radius); object-fit: cover; background: var(--ui-tint); border: 1px solid var(--ui-line); }
.org-hero__id { flex: 1 1 240px; min-width: 0; }
.org-name { margin: 0; font-family: var(--ui-font-head); font-weight: var(--ui-head-weight); font-size: 24px; letter-spacing: var(--ui-head-track); line-height: 1.25; color: var(--ui-ink); overflow-wrap: anywhere; }
.org-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; font-size: 14px; }
.org-hero__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.org-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.org-people { padding-bottom: 0; overflow: visible; }
.org-people__head { flex-wrap: wrap; }
.org-invite { position: relative; flex: 1 1 280px; max-width: 380px; }
.org-invite .ui-search { max-width: none; min-width: 0; }
.org-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); max-height: 280px; overflow-y: auto; padding: 6px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); background: #fff; box-shadow: var(--ui-shadow-lg); }
.org-result { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.org-result:hover { background: var(--ui-tint); }
.org-result__name { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--ui-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-tablewrap { position: relative; }
.org-tablewrap { overflow-x: auto; margin: 0 -22px; border: 0; border-top: 1px solid var(--ui-line); border-radius: 0 0 var(--ui-radius) var(--ui-radius); box-shadow: none; }
.org-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.org-person__name { font-weight: 600; color: var(--ui-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.org-actions { display: flex; justify-content: flex-end; gap: 8px; }
.org-people .role-select { width: auto; min-width: 110px; }
.org-people .pending-invite td { background: #fafbf9; }
.org-people .ui-empty { padding: 32px 20px; }
.org-preview { width: 96px; height: 96px; margin-top: 8px; border-radius: var(--ui-radius); object-fit: cover; border: 1px solid var(--ui-line); }
.org-skel-name { display: inline-block; width: 220px; height: 26px; }
.org-none { margin: 0; padding: 8px 12px 12px; font-size: 14px; color: var(--ui-muted); }
.org-btn { white-space: nowrap; }
.org-form { margin: 0; }

/* ------------------------------------------------------------------ admin */
.adm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.adm-find { max-width: none; }
.adm-quick { margin-top: 8px; }
@media (min-width: 1101px) { #admin_page .acc-two > .ui-card:first-child { position: sticky; top: calc(var(--ui-toolbar-h, 61px) + 16px); } }
.adm-ledger-head { flex-wrap: wrap; margin-bottom: 0; }
.acc-ledger { margin-top: 0; }
.adm-ledger-search { flex: 0 1 280px; min-width: 180px; }
.acc-ledger { margin: 0 -22px -20px; border: 0; border-top: 1px solid var(--ui-line); border-radius: 0 0 var(--ui-radius) var(--ui-radius); box-shadow: none; max-height: none; overflow-x: auto; }
#ledger_more { margin: 0; padding: 12px; border-top: 1px solid var(--ui-line); }
#token_ledger .acc-skel--row { margin: 6px 0; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
    .acc-two, .set-grid { grid-template-columns: 1fr; }
    .org-layout { grid-template-columns: 240px minmax(0, 1fr); }
    .msg-shell { grid-template-columns: 330px minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .org-layout { grid-template-columns: minmax(0, 1fr); }
    .org-side { position: static; }
    .org-list { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .prof-head { margin-top: -40px; }
    .acc-av--xl { width: 96px; height: 96px; }
}
@media (max-width: 760px) {
    .ui-pagehead__actions:has(.acc-search) { width: 100%; }
    .ui-pagehead__actions .acc-search { width: 100%; flex-basis: 100%; }
    /* one pane at a time: the list, or the open conversation */
    .msg-shell { display: block; height: clamp(520px, calc(100vh - 260px), 820px); }
    .msg-list-pane, .msg-thread-pane { height: 100%; border-right: 0; }
    .msg-shell .msg-thread-pane { display: none; }
    .msg-shell.has-thread .msg-list-pane { display: none; }
    .msg-shell.has-thread .msg-thread-pane { display: flex; }
    .msg-back { display: inline-flex; }
    .adm-stats, .org-stats { grid-template-columns: 1fr; }
    .ui-fields { grid-template-columns: 1fr; }
    .org-tablewrap { margin: 0 -16px; }
    .thread_message { max-width: 94%; }
}
@media (max-width: 560px) {
    .org-people .ui-table th:nth-child(3), .org-people .ui-table td:nth-child(3) { display: none; }
    .acc-ledger { margin: 0 -16px -16px; }
    #token_ledger th:nth-child(2), #token_ledger td:nth-child(2) { display: none; }
    .msg-compose { grid-template-columns: minmax(0, 1fr) auto; }
    .msg-compose .ui-textarea { grid-column: 1 / -1; grid-row: 1; }
    .msg-attach { grid-column: 1; grid-row: 2; justify-self: start; }
    .msg-compose__bar .ui-btn[type="submit"] { grid-column: 2; grid-row: 2; }
    .msg-thread__tools { flex: 1 1 100%; }
    .prof-head { padding: 0 16px 18px; }
    .prof-actions { padding-top: 0; width: 100%; }
    .set-pic { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    .msg-row, .org-item { transition: none; }
}

/* ------------------------------------------------------------------ profile settings: sections */
.set-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--ui-s4); align-items: start; }
.set-nav { position: sticky; top: 84px; display: grid; gap: 2px; }
.set-nav__a { padding: 9px 12px; border-radius: var(--ui-radius-xs); color: var(--ui-text); font-weight: 600; font-size: 14px; text-decoration: none; }
.set-nav__a:hover { background: var(--ui-sage-soft); color: var(--ui-ink); }
.set-main { display: grid; gap: var(--ui-s3); min-width: 0; }
.set-main > .ui-card { scroll-margin-top: 84px; }
.set-sub__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.set-sub__title { margin: 0; font-size: 16px; font-weight: 700; color: var(--ui-ink); }
.set-disabled { opacity: .65; margin-bottom: 18px; }
.set-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ui-text); }
#sec_payout .set-sub { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--ui-line); }
@media (max-width: 860px) {
    .set-layout { grid-template-columns: 1fr; }
    .set-nav { position: static; display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; margin: 0 -2px; }
    .set-nav__a { flex: none; border: 1px solid var(--ui-border); background: #fff; border-radius: 999px; padding: 6px 14px; }
}

/* ------------------------------------------------------------------ organizations: phone fit, roles legend */
@media (max-width: 760px) {
    .adm-stats, .org-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .org-stats .ui-stat { padding: 12px 10px; }
    .org-stats .ui-stat__label { font-size: 12px; letter-spacing: .3px; }
}
@media (max-width: 560px) {
    .org-people .ui-table th, .org-people .ui-table td { padding-left: 10px; padding-right: 10px; }
    .org-person__name { max-width: 104px; }
    .org-people .role-select { min-width: 92px; padding-right: 26px; }
    .org-tablewrap { margin: 0 -12px; }
    .org-hero { gap: 12px; }
    .org-hero__id { flex-basis: 160px; }
}
.org-roles { margin: 0; padding: 14px 22px 18px; border-top: 1px solid var(--ui-line); font-size: 14px; color: var(--ui-text); }
.org-roles > summary { cursor: pointer; font-weight: 600; color: var(--ui-ink); border-radius: var(--ui-radius-xs); }
.org-roles > summary:focus-visible { outline: 2px solid var(--ui-sage); outline-offset: 3px; }
.org-roles dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 12px 0 0; align-items: baseline; }
.org-roles dt { margin: 0; }
.org-roles dd { margin: 0; color: var(--ui-muted); }
#ledger_more { margin-top: 20px; } /* the ledger card has a -20px bottom margin that would pull this block over the last row */
.set-profile #sec_account { scroll-margin-top: 90px; }
