/* Forward Deployed portal: design tokens, base elements, components and the app shell.
   The palette and type follow the Forward Deployed site (warm paper, ink, teal and yellow,
   monospace labels), at app sizes. Page styles in the other files build on these tokens.
   No inline styles anywhere: the page security policy allows only these files. */

:root {
  color-scheme: light;
  /* Brand */
  --paper: #f2efe6; --paper-2: #e9e5da; --ink: #0a0d0f; --ink-2: #2a2f33;
  --cyan: #00c2cb; --yellow: #ffd800; --teal: #006f75; --teal-dark: #00575c;
  /* Surfaces and lines */
  --bg: var(--paper); --card: #fff; --surface: #f7f5ef; --sidebar-bg: #ebe7dc;
  --line: #dcd7ca; --line-strong: #c4bdae; --field: #8a8477;
  /* Text: every pair here is at least 4.5:1 on the backgrounds above. */
  --text: #1c2023; --muted: #5a5e5a;
  /* States */
  --accent: var(--teal); --accent-soft: #e3f3f3; --ok: #1f6b33; --ok-soft: #e8f3ed;
  --warn: #6b5b00; --warn-soft: #fff6cc; --rose: #a3203c; --rose-soft: #fdecef; --staff-soft: #fffbe6;
  /* Type */
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Shape */
  --radius: 2px; --radius-lg: 4px;
  --shadow: 0 1px 0 rgba(10, 13, 15, .04);
  --shadow-pop: 0 14px 36px rgba(10, 13, 15, .18), 0 2px 6px rgba(10, 13, 15, .08);
  --topbar-h: 60px; --sidebar-w: 248px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
h1 { font-size: 30px; line-height: 1.12; letter-spacing: -.035em; font-weight: 850; margin: 0 0 20px; color: var(--ink); overflow-wrap: anywhere; }
h2 { font-size: 18px; line-height: 1.3; letter-spacing: -.02em; font-weight: 750; margin: 0 0 8px; color: var(--ink); }
h3 { font-size: 15.5px; line-height: 1.35; letter-spacing: -.01em; font-weight: 700; margin: 0 0 6px; color: var(--ink); }
p { margin: 0 0 14px; }
strong { font-weight: 700; }
code { font: .86em/1.4 var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1px 5px; overflow-wrap: anywhere; }
time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
dd { overflow-wrap: anywhere; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Focus: an ink ring with a yellow halo, visible on every background. */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--yellow); }
:focus:not(:focus-visible) { outline: none; }
main:focus { outline: none; box-shadow: none; }

.eyebrow { font: 700 11px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 13.5px; }
.count { font: 700 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
/* Page header: eyebrow, title and the page's main action. */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; }
.page-heading > :last-child:not(:first-child) { flex-shrink: 0; }
.back { display: flex; align-items: center; gap: 6px; width: fit-content; font-size: 13.5px; font-weight: 600; margin: 0 0 14px; }

/* ---------- buttons ---------- */
button, input[type=submit], .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--card); color: var(--ink); font: 650 14px/1.25 var(--sans); text-align: center; text-decoration: none; white-space: normal; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
button:hover, input[type=submit]:hover, .button:hover { background: var(--paper-2); text-decoration: none; }
.primary { background: var(--ink) !important; color: #fff !important; border-color: var(--ink) !important; }
.primary:hover { background: var(--ink-2) !important; }
.quiet { border-color: transparent; background: transparent; color: var(--teal); padding: 6px 10px; min-height: 36px; }
.quiet:hover { background: var(--accent-soft); color: var(--teal-dark); }
button:disabled, input[type=submit]:disabled { cursor: not-allowed; color: #6a6e6a; background: var(--surface); border-color: var(--line-strong); }
.button_to { display: inline-block; margin: 0; }
.icon-button { width: 40px; height: 40px; min-height: 40px; padding: 0; display: inline-grid; place-items: center; border-color: var(--line-strong); background: var(--card); }
.icon-button .icon { width: 20px; height: 20px; }
.form-actions, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.form-actions input[type=submit], .form-actions button { margin: 0; }

/* ---------- forms ---------- */
label { display: block; font-size: 13.5px; font-weight: 650; color: var(--ink-2); margin: 16px 0 6px; }
input[type=text], input[type=number], input[type=email], input[type=search], input[type=url], input[type=password], input[type=datetime-local], select, textarea { display: block; width: 100%; min-width: 0; min-height: 42px; border: 1px solid var(--field); border-radius: var(--radius); background: #fff; color: var(--text); padding: 9px 12px; font-size: 15px; line-height: 1.4; }
textarea { resize: vertical; }
input[type=file] { display: block; max-width: 100%; font-size: 14px; }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); width: 17px; height: 17px; margin: 0; vertical-align: -3px; flex-shrink: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 1px; box-shadow: 0 0 0 4px var(--yellow); }
::placeholder { color: #6c706c; }
form input[type=submit] { margin-top: 16px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 13.5px; font-weight: 650; color: var(--ink-2); padding: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form > div { flex: 1 1 260px; min-width: 0; }
.inline-form label { margin-top: 0; }
.inline-form input[type=submit], .inline-form button { margin: 0; }

/* ---------- cards and sections ---------- */
.card, .form-section, .access-section, .account-section, .help, .without-nav .onboarding, .error-page { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px 24px; margin: 0 0 20px; min-width: 0; }
:is(.card, .form-section, .access-section, .account-section, .without-nav .onboarding) :is(.card, .form-section, .access-section) { background: var(--surface); box-shadow: none; padding: 18px 20px; margin: 16px 0 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.section-heading h2 { margin: 0; }
.section-heading a { font-size: 13.5px; font-weight: 600; }
.onboarding { max-width: 880px; }
.onboarding form + p, .onboarding .form-section + p { margin-top: 18px; }
.without-nav .onboarding { max-width: none; padding: 30px 32px; }
.error-page { max-width: 720px; padding: 30px 32px; }
.error-page a { margin-right: 18px; }
.error-page .button { margin: 6px 18px 0 0; }

/* Definition lists of facts, such as a consent request or a job to confirm. */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 16px 0 20px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); font-size: 14px; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }

/* ---------- lists ---------- */
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 14px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.list-row p { margin: 3px 0 0; }
.list-row h3 { margin: 0; }
.list-row > :last-child { flex-shrink: 0; }
.organization-list, .workspace-list, .member-list, .list-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); margin: 0 0 20px; }
.organization-list > .list-row, .list-card > .list-row, .member-list > .member-row, .workspace-list > .workspace-row { padding: 16px 20px; }
.organization-list > :first-child, .list-card > :first-child, .member-list > :first-child, .workspace-list > :first-child { border-top: 0; }
:is(.card, .form-section, .access-section, .account-section) .organization-list { background: none; border: 0; box-shadow: none; margin: 0; }
:is(.card, .form-section, .access-section, .account-section) .organization-list > .list-row { padding: 14px 0; border-top: 1px solid var(--line); }
.workspace-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; transition: background-color .15s; }
.workspace-row:hover { background: var(--surface); text-decoration: none; }
.card .workspace-row { margin: 0 -24px; padding: 13px 24px; }
.workspace-mark { width: 40px; height: 40px; display: grid; place-items: center; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 850; font-size: 16px; flex-shrink: 0; }
.workspace-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.workspace-title strong { color: var(--ink); }
.workspace-title span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.workspace-row > [aria-hidden=true]:last-child { color: var(--muted); }
.workspace-list > .empty { border: 0; margin: 0; background: none; }

/* ---------- badges, notices, empty states ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font: 700 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 5px 8px; white-space: nowrap; }
.notice { padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: var(--radius); background: #eef7f7; color: var(--ink-2); margin: 0 0 20px; font-size: 14.5px; }
.notice.alert { background: var(--rose-soft); border-left-color: var(--rose); }
.empty { text-align: center; padding: 34px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); margin: 8px 0; }
.empty::before { content: ""; display: block; width: 10px; height: 10px; margin: 0 auto 18px; background: var(--cyan); box-shadow: 14px 0 0 var(--yellow), -14px 0 0 var(--ink); }
.empty h2 { font-size: 17px; }
.empty p { max-width: 440px; margin: 0 auto 10px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: block; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; font-weight: 650; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 700 10.5px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--surface); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfbf8; }
/* On phones a wide table scrolls inside its frame instead of crushing its columns. */
@media (max-width: 700px) { .table-wrap > table:not(.charges-table):not(.stack):not(.compact) { min-width: 560px; } }

/* ---------- details ---------- */
summary { cursor: pointer; }
.help { padding: 0; }
.help > summary { display: flex; align-items: center; gap: 10px; padding: 14px 20px; font-weight: 700; font-size: 14.5px; color: var(--ink); list-style: none; }
.help > summary::-webkit-details-marker { display: none; }
.help > summary::before { content: "+"; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--ink); border-radius: var(--radius); font: 700 14px/1 var(--mono); }
.help[open] > summary::before { content: "−"; }
.help > form { padding: 0 20px 20px; }
.help label { margin-top: 0; }

/* ---------- app shell ---------- */
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; font-weight: 700; border-radius: var(--radius); }
.skip-link:focus { top: 10px; text-decoration: none; }
.development { font: 700 11px/1.2 var(--mono); letter-spacing: .06em; background: #fcebf0; color: #8a3050; padding: 7px 20px; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 16px 0 20px; background: rgba(242, 239, 230, .95); backdrop-filter: saturate(1.2) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); margin-right: 6px; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; object-fit: contain; }
.brand-name { display: flex; flex-direction: column; font-size: 20px; font-weight: 900; letter-spacing: -.05em; line-height: 1; }
.workspace-label { font: 700 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line); padding-left: 16px; }
.nav-toggle { display: none; }

/* Header menus: native <details>, closed by shell.js on Escape or an outside click. */
.menu { position: relative; }
.menu > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 5px 8px; border: 1px solid transparent; border-radius: var(--radius); user-select: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: rgba(10, 13, 15, .05); }
.menu[open] > summary { background: var(--card); border-color: var(--line); }
.menu .chevron { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.menu[open] .chevron { transform: rotate(180deg); }
.menu-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; width: max-content; min-width: 250px; max-width: min(330px, calc(100vw - 24px)); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 6px; }
.menu-panel-end { left: auto; right: 0; }
.menu-heading { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.menu-heading strong { font-size: 15px; color: var(--ink); }
.menu-heading span { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 600 10.5px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.menu-item { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: var(--radius); background: none; color: var(--text); font: 550 14px/1.3 var(--sans); text-align: left; text-decoration: none; }
.menu-item:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.menu-item .icon { width: 18px; height: 18px; color: var(--muted); }
.menu-signout { display: block; margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
.org-menu { border-left: 1px solid var(--line); padding-left: 10px; min-width: 0; }
.org-avatar { width: 30px; height: 30px; display: grid; place-items: center; flex-shrink: 0; background: var(--ink); color: var(--yellow); border-radius: var(--radius); font: 850 14px/1 var(--sans); }
.org-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.org-name { font-weight: 700; font-size: 14px; color: var(--ink); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-role { font: 600 10px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.account-menu { margin-left: auto; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--ink); color: #fff; font: 750 12.5px/1 var(--sans); letter-spacing: .02em; }
.avatar.tone-1 { background: var(--teal); }
.avatar.tone-2 { background: #4a5a52; }
.account-menu-name { font-weight: 600; font-size: 14px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); background: linear-gradient(90deg, var(--sidebar-bg) calc(var(--sidebar-w) - 1px), var(--line) calc(var(--sidebar-w) - 1px), var(--line) var(--sidebar-w), transparent var(--sidebar-w)); }
.shell.without-nav { display: block; background: none; }
.sidebar { position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 18px 12px 16px; background: var(--sidebar-bg); border-right: 1px solid var(--line); scrollbar-width: thin; }
.drawer-head, .sidebar-org, .nav-backdrop { display: none; }
.sidebar-nav { display: flex; flex-direction: column; gap: 18px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font: 700 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 4px 12px 8px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; min-height: 38px; padding: 8px 12px; border-radius: var(--radius); color: var(--ink-2); font-size: 14.5px; font-weight: 550; text-decoration: none; }
.nav-item .icon { color: var(--muted); }
.nav-item:hover { background: rgba(10, 13, 15, .05); color: var(--ink); text-decoration: none; }
.nav-item[aria-current=page] { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); }
.nav-item[aria-current=page]::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; background: var(--cyan); }
.nav-item[aria-current=page] .icon { color: var(--teal); }
.nav-item:focus-visible { box-shadow: 0 0 0 5px var(--yellow); }
.sidebar-footer { margin-top: auto; padding: 16px 0 0; display: flex; flex-direction: column; gap: 14px; }

/* The connector address, one click to copy. */
.connector { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px; }
.connector-label { display: flex; align-items: center; gap: 6px; font: 700 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.connector-label .icon { width: 14px; height: 14px; color: var(--teal); }
.connector-copy { display: flex; align-items: stretch; border: 1px solid var(--ink); border-radius: var(--radius); background: #fff; }
.connector-url { flex: 1; min-width: 0; padding: 8px 10px; font: 650 12px/1.35 var(--mono); color: var(--ink); overflow-wrap: anywhere; user-select: all; }
.connector-button { flex-shrink: 0; min-height: 36px; padding: 0 12px; border: 0; border-left: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: #fff; font: 800 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.connector-button:hover { background: var(--ink-2); }
.connector-button:focus-visible { outline: 2px solid var(--yellow); outline-offset: -4px; box-shadow: none; }
.sidebar .connector-copy { flex-direction: column; }
.sidebar .connector-url { font-size: 11px; padding: 8px; }
.sidebar .connector-button { min-height: 32px; border-left: 0; border-top: 1px solid var(--ink); }

.content { min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1240px; min-width: 0; padding: 32px 40px 56px; }
.without-nav main { max-width: 820px; margin: 0 auto; padding-top: 40px; }

/* ---------- conversation ---------- */
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 22px; }
.subnav a { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--card); color: var(--ink-2); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.subnav a:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.subnav .icon { width: 16px; height: 16px; color: var(--teal); }
.conversation { max-width: 980px; }
.chat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 20px; }
.chat-log { max-height: min(64vh, 680px); min-height: 240px; overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 12px; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
#messages { display: flex; flex-direction: column; gap: 18px; }
#messages > a { align-self: center; font-size: 13.5px; font-weight: 600; }
.message { display: flex; gap: 12px; align-items: flex-start; max-width: 780px; }
.message-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--ink); color: #fff; font: 750 12.5px/1 var(--sans); }
.message-avatar.tone-1 { background: var(--teal); }
.message-avatar.tone-2 { background: #4a5a52; }
.message-content { flex: 1; min-width: 0; }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 5px; font-size: 13px; }
.message-meta strong { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; }
.message-meta .staff-badge { margin-left: 0; }
.message-bubble { display: inline-block; max-width: 100%; margin: 0; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 2px 14px 14px 14px; color: var(--text); font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.is-staff .message-avatar { background: var(--yellow); color: var(--ink); }
.message.is-staff .message-bubble { background: var(--staff-soft); border-color: #ecd66f; }
.chat-log .empty { border: 0; background: none; }
.chat-status { margin: 0; padding: 0 22px; font-size: 12.5px; background: var(--surface); }
.composer { border-top: 1px solid var(--line); padding: 14px 16px 16px; }
.composer label { margin-top: 0; }
.composer textarea { min-height: 72px; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.composer-actions input[type=submit] { margin: 0; }

/* ---------- member rows ---------- */
.member-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.member-row h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15.5px; margin: 0 0 6px; }
.member-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.member-form label { margin: 0 0 6px; white-space: nowrap; }
.member-form > label { display: flex; align-items: center; gap: 8px; min-height: 40px; margin: 0; font-weight: 550; }
.member-form select { width: auto; min-width: 150px; }
.member-form input[type=submit], .member-form button { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  main { padding: 28px 28px 48px; }
  .account-menu-name { display: none; }
}
@media (max-width: 899px) {
  .shell { display: block; background: none; }
  .topbar { padding: 0 12px; gap: 8px; }
  .nav-toggle { display: inline-grid; }
  html:not(.js) .nav-toggle { display: none; }
  .brand { margin-right: 0; }
  .workspace-label { display: none; }
  .org-menu { margin-left: auto; border-left: 0; padding-left: 0; }
  .org-menu .menu-panel { left: auto; right: 0; }
  .org-menu + .account-menu { margin-left: 0; }
  /* The sidebar becomes a drawer; without JavaScript it stays open above the page. */
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .js .sidebar { position: fixed; z-index: 70; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); height: auto; padding-top: 12px; border-right: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); transform: translateX(-102%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
  .nav-open .sidebar { transform: none; visibility: visible; transition: transform .22s ease; }
  .nav-open { overflow: hidden; }
  .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(10, 13, 15, .42); }
  .js .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 8px 12px; }
  .drawer-title { font: 700 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .sidebar-org { display: flex; flex-direction: column; gap: 3px; margin: 0 0 6px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow-wrap: anywhere; }
  .sidebar-org strong { color: var(--ink); }
  .sidebar-org span { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 600 10.5px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .sidebar-org a { font-size: 13.5px; font-weight: 600; margin-top: 4px; }
  html:not(.js) .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  main { padding: 24px 24px 48px; }
  .without-nav main { padding-top: 28px; }
}
@media (max-width: 600px) {
  .brand-name { font-size: 18px; }
  .development { font-size: 10px; letter-spacing: .02em; padding: 6px 16px; }
  .menu .chevron { display: none; }
  .menu > summary { padding: 5px; }
  .org-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  main { padding: 20px 16px 40px; }
  h1 { font-size: 26px; }
  .card, .form-section, .access-section, .account-section, .without-nav .onboarding, .error-page { padding: 18px 16px; }
  .help { padding: 0; }
  .card .workspace-row { margin: 0 -16px; padding: 12px 16px; }
  .organization-list > .list-row, .list-card > .list-row, .member-list > .member-row, .workspace-list > .workspace-row { padding: 14px 16px; }
  .page-heading { align-items: flex-start; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form > div { flex-basis: auto; width: 100%; }
  .list-row { flex-wrap: wrap; }
  .workspace-row { gap: 12px; }
  .workspace-row .badge { display: none; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .subnav { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .chat-log { max-height: 62vh; padding: 16px 12px 8px; }
  .message { gap: 10px; }
  .message-avatar { width: 30px; height: 30px; font-size: 11.5px; }
  .chat-status { padding: 0 12px; }
  .composer { padding: 12px; }
  .composer-actions { flex-wrap: wrap; }
  .composer-actions .muted { flex: 1 1 160px; font-size: 12.5px; }
  .member-row { align-items: stretch; flex-direction: column; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
/* Ask Us Anything: the team's answers under each question. */
.ask-answer { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--cyan); background: var(--surface); }
.ask-answer p { margin: 0 0 4px; white-space: pre-wrap; }
/* Platform admin: what is waiting (menu counts and the attention box). */
.nav-count { margin-left: auto; min-width: 20px; padding: 2px 6px; border-radius: 10px; background: var(--yellow); color: var(--ink); font: 700 11px/16px var(--mono); text-align: center; }
.attention { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--line-strong); border-left: 4px solid var(--yellow); background: var(--warn-soft); border-radius: var(--radius); }
.attention ul { margin: 6px 0 0; padding-left: 18px; }
/* Learning and Perks lists. */
.learning-list { display: grid; gap: 12px; }
.learning-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.learning-item h2 { font-size: 18px; margin: 2px 0 8px; }
.learning-item p { margin: 0 0 8px; }
.ask-conversation { border-top: 1px solid var(--line); padding: 14px 0; }
.ask-answer.from-you { border-left-color: var(--line-strong); background: var(--card); }
.ask-reply { margin-top: 8px; display: grid; gap: 6px; max-width: 640px; }

/* The Forward Deployed wordmark: the d shared by "forward" and "deployed", squared. */
.wordmark { white-space: nowrap; letter-spacing: inherit; }
.wordmark .wm-d { color: var(--teal, #006f75); position: relative; }
.wordmark .wm-d sup { position: absolute; top: -.18em; right: -.28em; font-size: .48em; line-height: 1; vertical-align: baseline; }
.brand-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
