/* La Sala. A quiet workspace; each Sala supplies its own accent. */

:root {
  --accent: #14B8A6;
  --ink: #202322;
  --navy: #202322;
  --navy-2: #2A302E;
  --navy-3: #353B38;

  --bg: #FAFAF9;
  --panel: #FFFFFF;
  --text: #282B2A;
  --muted: #70756F;
  --line: #E9EBE8;
  --hover: #F2F3F0;
  --code-bg: #F4F5F2;
  --pill: #F1F3F0;
  --highlight: #F8F6EC;
  --danger: #C13B32;
  --side-bg: #F6F5F3;
  --side-text: #505550;
  --side-muted: #6E726B;
  --positive: #357552;
  --warning: #94601D;
  --info: #4966A4;
  --negative: #AA4741;
  --link: #526B61;
  --shadow: 0 3px 16px rgba(25, 35, 28, .04), 0 1px 3px rgba(25, 35, 28, .03);

  --radius: 12px;
  --conversation-width: 880px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --display: var(--font);
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1A1C1B;
    --panel: #202321;
    --text: #E5E9E5;
    --muted: #A2ABA3;
    --line: #343B35;
    --hover: #2B312C;
    --code-bg: #292F2A;
    --pill: #2E352F;
    --highlight: #393728;
    --side-bg: #1B1E1C;
    --side-text: #BAC2BB;
    --side-muted: #8E998F;
    --positive: #92C6A3;
    --warning: #E3BC76;
    --info: #A0B8E6;
    --negative: #E9A49E;
    --danger: #E9A49E;
    --link: #A1C9B4;
    --shadow: 0 3px 16px rgba(0, 0, 0, .12);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1A1C1B; --panel: #202321; --text: #E5E9E5; --muted: #A2ABA3;
  --line: #343B35; --hover: #2B312C; --code-bg: #292F2A; --pill: #2E352F;
  --highlight: #393728; --side-bg: #1B1E1C; --side-text: #BAC2BB; --side-muted: #8E998F;
  --positive: #92C6A3; --warning: #E3BC76; --info: #A0B8E6; --negative: #E9A49E; --danger: #E9A49E; --link: #A1C9B4; --shadow: 0 3px 16px rgba(0, 0, 0, .12);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.6 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, textarea { font: inherit; color: inherit; min-width: 0; }
button:disabled { cursor: default; opacity: .5; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.btn { border: 1px solid transparent; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-accent { background: var(--text); color: var(--panel); }
.btn-accent:hover { background: color-mix(in srgb, var(--text) 85%, var(--panel)); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); background: var(--hover); }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 6px; display: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }

/* Splash */
.splash { min-height: 100%; display: grid; place-items: center; background: var(--bg); color: var(--text); padding: 24px; }
.splash-card { text-align: center; max-width: 380px; }
.splash-card h1 { font-family: var(--display); font-weight: 600; font-size: 34px; margin: 16px 0 6px; letter-spacing: -0.04em; }
.splash-card p { color: var(--muted); margin: 0 0 24px; }
.splash-card .small { margin-top: 16px; color: var(--muted); }

/* Layout */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); height: 100vh; height: 100dvh; }
.sidebar { background: var(--side-bg); color: var(--side-text); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 14px 16px; gap: 20px; overflow: hidden; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--panel); position: relative; }
.rail { width: 320px; border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 22px; }

/* Sidebar */
.brand { display: flex; align-items: center; gap: 7px; padding: 0 3px; }
.brand > img { width: 28px; height: 28px; flex: none; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: -0.03em; color: var(--text); }
.brand-sub { font-size: 11px; color: var(--side-muted); }
.live { margin-left: auto; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 5px; border-radius: 5px; background: var(--hover); color: var(--muted); }
.live.on { background: color-mix(in srgb, var(--positive) 8%, var(--side-bg)); color: var(--positive); }
.live.off { background: color-mix(in srgb, var(--danger) 8%, var(--side-bg)); color: var(--danger); }
#new-msg { background: var(--panel); color: var(--text); border-color: var(--line); justify-content: flex-start; padding: 9px 12px; box-shadow: 0 1px 2px rgba(0,0,0,.02); }
#new-msg:hover { border-color: color-mix(in srgb, var(--muted) 35%, var(--line)); background: var(--hover); }
#new-msg > span { width: 16px; font-size: 19px; font-weight: 400; line-height: 1; color: var(--muted); }
#nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.nav-section { margin: 20px 0 5px; }
.nav-section:first-child { margin-top: 0; }
.nav-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: 0.085em; color: var(--side-muted); padding: 0 10px 6px; font-weight: 500; }
.nav-head button { background: none; border: 0; color: var(--side-muted); padding: 0; font-size: 11px; }
.nav-item { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 1px solid transparent; color: var(--side-text); text-align: left; padding: 6px 9px; border-radius: 7px; font-size: 12.5px; min-height: 34px; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--panel); border-color: var(--line); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.025); }
.nav-item.active .badge { background: var(--pill); color: var(--text); }
.nav-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 11px; color: var(--side-muted); padding: 0 4px; }
.nav-item.active .count { color: var(--muted); background: var(--pill); border-radius: 4px; }
.nav-item.sub { padding-left: 30px; font-size: 12px; color: var(--side-muted); min-height: 30px; }
.nav-item.archived { opacity: 0.55; }
.badge { background: var(--pill); color: var(--text); font-size: 11px; font-weight: 600; border-radius: 5px; padding: 0 6px; min-width: 19px; text-align: center; }
.hash { color: var(--side-muted); width: 14px; text-align: center; }
.nav-item.active .hash { color: var(--muted); }
.me { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 4px 0; border-top: 1px solid var(--line); font-size: 11.5px; }
.me .who { flex: 1; min-width: 0; }
.me .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who div:last-child { color: var(--side-muted); font-size: 11px; }
.me button { background: none; border: 0; color: var(--side-muted); font-size: 11px; padding: 2px 0; }
.me button:hover { color: var(--text); }

/* Avatars */
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 600; font-size: 11px; color: var(--text); flex: none; font-family: var(--font); background: color-mix(in srgb, var(--avatar-color, var(--muted)) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--avatar-color, var(--muted)) 15%, var(--line)); }
.avatar.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 9px; }
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 19px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Top bar and conversation navigation */
.topbar { display: flex; align-items: center; gap: 16px; min-height: 83px; padding: 18px 32px; border-bottom: 1px solid var(--line); background: var(--panel); }
.title-wrap { flex: 1; min-width: 0; }
.topbar h1 { font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -0.035em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { width: 196px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 8px 11px; font-size: 12px; }
.search::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.search:focus, .composer input:focus, .composer textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.view-actions { display: flex; gap: 6px; }
.conversation-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; width: min(calc(100% - 64px), var(--conversation-width)); margin: 0 auto; padding: 20px 0 12px; flex: none; }
.conversation-tabs { display: flex; align-items: center; gap: 4px; }
.conversation-tab { border: 0; border-radius: 7px; padding: 7px 12px; background: transparent; color: var(--muted); font-size: 12px; }
.conversation-tab:hover { color: var(--text); background: var(--bg); }
.conversation-tab[aria-pressed="true"] { color: var(--text); background: var(--hover); font-weight: 600; }
#conversation-count { font-size: 11px; color: var(--muted); margin-left: auto; }

/* Stream */
.stream { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 5px 0 24px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; scroll-padding: 24px; }
.empty { text-align: center; color: var(--muted); padding: 64px 24px; }
.day { display: flex; align-items: center; gap: 12px; width: min(calc(100% - 64px), var(--conversation-width)); margin: 22px auto 10px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .065em; color: var(--muted); }
.day::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.msg { display: flex; gap: 13px; width: min(calc(100% - 64px), var(--conversation-width)); margin: 0 auto; padding: 20px 0; position: relative; }
.msg.target { background: var(--highlight); border-radius: 10px; box-shadow: 0 0 0 10px var(--highlight); }
.msg-main { flex: 1; min-width: 0; }
.msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; min-height: 22px; }
.sender { font-size: 13px; font-weight: 600; background: none; border: 0; padding: 0; color: var(--text); }
.sender:hover { text-decoration: underline; }
.arrow { color: var(--muted); font-size: 11px; }
.to { color: var(--muted); font-size: 11px; }
.to b { color: var(--muted); font-weight: 500; }
.time { color: var(--muted); font-size: 11px; text-decoration: none; }
.time:hover { text-decoration: underline; }
.pill { font-size: 11px; background: var(--pill); color: var(--muted); border-radius: 5px; padding: 2px 7px; border: 0; max-width: 100%; overflow-wrap: anywhere; }
button.pill:hover { color: var(--text); background: var(--hover); }
.pill.imported { background: transparent; border: 1px solid var(--line); font-size: 11px; padding: 0 5px; }
.subject-line { font-weight: 600; margin-top: 3px; overflow-wrap: anywhere; }
.body { overflow-wrap: anywhere; }
.body.clamped { max-height: 420px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }
.more { background: none; border: 0; color: var(--link); font-weight: 500; padding: 4px 0; font-size: 12px; }
.body p { margin: 6px 0; }
.body h3, .body h4, .body h5, .body h6 { margin: 12px 0 4px; font-size: 14px; }
.body h3 { font-size: 15px; }
.body code { font-family: var(--mono); font-size: 12px; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
.body pre { background: var(--code-bg); padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; font-size: 12px; }
.body pre code { background: none; padding: 0; }
.body blockquote { margin: 8px 0; padding: 2px 14px; border-left: 2px solid var(--line); color: var(--muted); }
.body ul, .body ol { margin: 6px 0; padding-left: 22px; }
.body hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.body a { color: var(--link); text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); text-underline-offset: 3px; }
.md-table { overflow-x: auto; margin: 8px 0; }
.body table { border-collapse: collapse; font-size: 13px; }
.body th, .body td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.body th { background: var(--code-bg); }
.body .al-center { text-align: center; }
.body .al-right { text-align: right; }
.task.done { color: var(--positive); }
.msg-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.msg-footer .pill { background: transparent; border: 1px solid var(--line); padding: 2px 7px; }
.jump { position: absolute; left: 50%; transform: translateX(-50%); bottom: 200px; background: var(--text); color: var(--panel); border: 0; border-radius: 99px; padding: 8px 15px; font-size: 12px; font-weight: 500; box-shadow: var(--shadow); z-index: 2; }

/* Thread overview */
.thread-overview { width: min(calc(100% - 64px), var(--conversation-width)); margin: 12px auto 28px; }
.thread-overview-head { margin-bottom: 22px; }
.thread-overview-head h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -.035em; }
.thread-overview-head p { margin: 0; color: var(--muted); font-size: 12px; }
a.thread-card { display: block; color: inherit; text-decoration: none; padding: 19px 0; border-top: 1px solid var(--line); }
a.thread-card:hover .thread-name { color: var(--link); }
.thread-card-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.thread-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.thread-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; color: var(--muted); font-size: 13px; line-height: 1.65; margin: 6px 0 9px; }
.thread-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 11px; color: var(--muted); }

/* Composer */
.composer { flex: none; width: min(calc(100% - 64px), var(--conversation-width)); margin: 0 auto 22px; padding: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.project-compose { flex: none; width: min(calc(100% - 64px), var(--conversation-width)); margin: 0 auto; padding: 10px 0 18px; }
.project-compose-button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--muted); padding: 18px 18px; font-size: 13px; box-shadow: var(--shadow); }
.project-compose-button:hover { border-color: color-mix(in srgb, var(--muted) 35%, var(--line)); color: var(--text); }
.project-compose-button > span { min-width: 0; overflow-wrap: anywhere; }
.project-compose-button svg { flex: none; }
.project-compose-hint { text-align: center; margin: 8px 0 0; font-size: 11px; color: var(--muted); }
.compose-row { display: flex; gap: 8px; flex-wrap: wrap; }
.field { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; background: var(--bg); min-height: 36px; }
.field > span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 500; }
.field:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.field input { border: 0; background: transparent; padding: 4px 2px; min-width: 60px; flex: 1; outline: none !important; font-size: 13px; }
.to-field { flex: 1 1 320px; flex-wrap: wrap; }
.small-field { flex: 0 1 180px; }
.chips { display: contents; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--pill); border-radius: 5px; padding: 2px 4px 2px 8px; font-size: 12px; font-weight: 500; max-width: 100%; overflow-wrap: anywhere; }
.chip button { border: 0; background: none; color: var(--muted); padding: 0 4px; font-size: 14px; line-height: 1; }
.subject { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--bg); font-size: 13px; min-width: 0; }
.compose-body { display: flex; gap: 8px; align-items: flex-end; }
.compose-body textarea { flex: 1; resize: vertical; min-height: 64px; max-height: 40vh; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); }
.compose-error { color: var(--danger); font-size: 12px; min-height: 0; }
.compose-error:empty { display: none; }

/* Rail */
.rail h2 { font-family: var(--display); font-size: 16px; font-weight: 600; letter-spacing: -.02em; margin: 10px 0 2px; }
.rail .close { float: right; background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; }
.rail dl { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; font-size: 13px; margin: 14px 0; }
.rail dt { color: var(--muted); }
.rail dd { margin: 0; overflow-wrap: anywhere; }
.rail .lanes { display: flex; flex-wrap: wrap; gap: 4px; }
.rail .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.participants { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.participants button { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 2px 0; color: var(--text); text-align: left; }

/* Mobile */
@media (max-width: 1100px) { .rail { position: fixed; right: 0; top: 0; bottom: 0; z-index: 30; box-shadow: -8px 0 30px rgba(0,0,0,.1); } }
@media (max-width: 800px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, 90vw); z-index: 40; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 8px 0 30px rgba(0,0,0,.12); }
  .sidebar.open { transform: none; }
  .icon-btn { display: inline-flex; flex: none; }
  .topbar { padding: 14px 16px; gap: 10px; min-height: 74px; flex-wrap: wrap; }
  .topbar h1 { font-size: 16px; }
  .search { width: 140px; }
  .msg, .day, .conversation-bar, .composer, .project-compose, .thread-overview { width: calc(100% - 32px); }
  .conversation-bar { padding: 14px 0 6px; gap: 8px; }
  .conversation-tab { padding: 6px 9px; }
  .msg { padding: 16px 0; gap: 10px; font-size: 13px; }
  .msg > .avatar { width: 30px; height: 30px; font-size: 10px; border-radius: 9px; }
  .composer { margin-bottom: 14px; }
  .project-compose { padding-bottom: 12px; }
  .to-field { flex-basis: 100%; }
  .small-field { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .compose-body textarea { min-height: 44px; }
  .rail { width: min(100%, 360px); }
  .view-actions .btn { padding: 6px 10px; }
}
@media (max-width: 480px) {
  .topbar { gap: 8px; }
  .title-wrap { flex-basis: calc(100% - 46px); }
  .search { width: 100%; flex: 1; }
  .view-sub { font-size: 11px; }
  .conversation-bar { gap: 8px 4px; }
  #conversation-count { font-size: 11px; }
  .conversation-tab { padding: 6px 8px; font-size: 11px; }
  .reply-context { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ------------------------------------------------------------ app pages */

.ws-switch { background: none; border: 0; color: inherit; text-align: left; padding: 2px 4px; border-radius: 6px; min-width: 0; flex: 1; }
.ws-switch:hover { background: var(--hover); }
.ws-switch .brand-name, .ws-switch .brand-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.nav-item { text-decoration: none; }
.page { flex: 1; min-height: 0; overflow-y: auto; }
.page-inner { padding: 28px 32px; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page-inner.narrow { max-width: 760px; }
.page-inner.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.page-loading { padding: 40px; color: var(--muted); text-align: center; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lede { font-size: 15px; color: var(--muted); margin: 0; }
.section-title { font-family: var(--display); font-size: 15px; margin: 8px 0 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card h3 { margin: 0; font-size: 15px; }
.card p { margin: 0; }
.card pre { background: var(--code-bg); padding: 10px 12px; border-radius: 8px; overflow-x: auto; margin: 0; font-size: 12.5px; }
.side-stack { display: flex; flex-direction: column; gap: 12px; }
.side-stack .btn { width: 100%; }

.steps { display: grid; gap: 10px; }
.step { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; }
.step:hover { border-color: var(--accent); }
.step h3 { margin: 0; font-size: 15px; }
.step p { margin: 2px 0 0; }
.step-num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 600; background: var(--pill); font-family: var(--display); }
.step.done .step-num { background: var(--pill); color: var(--positive); }
.step-summary { font-weight: 500; }
.step-cta { color: var(--muted); font-size: 13px; font-weight: 600; }
.step-cta::after { content: ' ›'; }

.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.member-card { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-decoration: none; color: inherit; }
.member-card:hover { border-color: var(--accent); }
.member-card.retired { opacity: 0.55; }
.member-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.member-name { font-weight: 600; }
.member-role { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.member-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.status { font-size: 11px; font-weight: 500; border-radius: 99px; padding: 1px 8px; background: var(--pill); color: var(--muted); }
.status-active { background: color-mix(in srgb, var(--positive) 10%, var(--panel)); color: var(--positive); }
.status-onboarding { background: rgba(245, 158, 11, 0.18); color: var(--warning); }
.status-invited { background: rgba(99, 102, 241, 0.14); color: var(--info); }
.mission { margin-top: 4px; }
.mission p { margin: 2px 0 0; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.form-hint { font-size: 11.5px; color: var(--muted); }
.form-field input:not([type="checkbox"]):not([type="color"]):not([type="file"]), .form-field textarea, .form-field select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); width: 100%; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.form-field input:disabled, .form-field textarea:disabled, .form-field select:disabled { opacity: 0.7; }
.form-field input[type="color"] { width: 56px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 2px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-error { color: var(--danger); font-size: 13px; }
.form-error:empty { display: none; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; margin-right: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 0; }
.btn-small { padding: 4px 10px; font-size: 12.5px; width: auto !important; }
.warn { background: var(--highlight); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 0; }
textarea.kit { width: 100%; font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--code-bg); resize: vertical; }
textarea.doc-body { font-family: var(--mono); font-size: 12.5px; }

.token-list, .history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.token-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: space-between; }

.doc-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.doc-row { display: block; padding: 10px 14px; text-decoration: none; color: inherit; border-top: 1px solid var(--line); }
.doc-row:first-child { border-top: 0; }
.doc-row:hover { background: var(--hover); }
.doc-title { font-weight: 600; }
.doc-source { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.body.doc { font-size: 14px; }
.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.repo-head h3 { display: inline; }

.modal-wrap { position: fixed; inset: 0; background: rgba(8, 10, 20, 0.55); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--panel); color: var(--text); border-radius: 14px; width: min(720px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-family: var(--display); font-size: 17px; margin: 0; }
.modal-head .close { background: none; border: 0; font-size: 22px; color: var(--muted); line-height: 1; }
.modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-body p { margin: 0; }
.ws-list { display: flex; flex-direction: column; gap: 6px; }
.ws-option { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 10px 10px; color: inherit; }
.ws-logo { width: 36px; height: 36px; flex: none; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; overflow: hidden; }
.ws-logo img { width: 26px; height: 26px; object-fit: contain; }
.ws-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ws-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-option:hover { border-color: var(--accent); }
.ws-option .pill { margin-left: auto; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: calc(100% - 32px); }
.toast { background: var(--navy); color: #fff; padding: 9px 16px; border-radius: 99px; font-size: 13.5px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.error { background: var(--negative); color: var(--panel); }
.empty h3 { font-family: var(--display); margin: 0 0 6px; color: var(--text); }
.empty .btn { margin-top: 12px; }
#splash-extra { margin-top: 16px; }

@media (max-width: 900px) { .page-inner.two-col { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 800px) {
  .page-inner { padding: 16px; }
  .step { grid-template-columns: 34px minmax(0, 1fr); }
  .step-cta { display: none; }
  .member-grid, .repo-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------ Sofi and governance */

.sofi { display: flex; flex-direction: column; gap: 14px; max-width: 640px; margin: 0 auto; width: 100%; }
.sofi-head { display: flex; align-items: center; gap: 10px; }
.sofi-avatar { width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, #F472B6 18%, var(--panel)); color: var(--text); display: grid; place-items: center; font-family: var(--display); font-weight: 600; flex: none; }
.sofi-name { font-weight: 600; }
.sofi-role { font-size: 12px; color: var(--muted); }
.sofi-bubble { background: var(--panel); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 14px 16px; font-size: 15.5px; line-height: 1.55; }
.sofi-body { display: flex; flex-direction: column; gap: 10px; }
.sofi-input { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: var(--panel); font-size: 15px; width: 100%; }
.sofi-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.sofi-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.sofi-next { min-width: 140px; }
.btn.big { padding: 12px 18px; font-size: 15px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--text); }
.tile:hover, .tile.picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tile span { color: var(--muted); font-size: 13px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px dashed var(--line); border-radius: 12px; padding: 22px; cursor: pointer; background: var(--panel); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone { position: relative; }
.dropzone:focus-within { outline: 2px solid var(--accent); }
.dropzone > span:first-of-type { font-weight: 600; color: var(--text); }
.sofi-files { margin: 0; padding-left: 20px; font-size: 13.5px; }
.sofi-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.sofi-details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.waiting { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 6px 0; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.sofi-banner { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.sofi-banner > div:nth-child(2) { flex: 1; min-width: 0; }
.sofi-banner p { margin: 2px 0 0; }
.sofi-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 70; overflow-y: auto; padding: 48px 16px; }
.sofi-close { position: fixed; top: 14px; right: 18px; background: none; border: 0; font-size: 26px; color: var(--muted); }
.splash-sofi { text-align: left; color: var(--text); margin-top: 8px; }
.splash-card:has(.splash-sofi) { max-width: 640px; }

.duty { font-size: 11px; font-weight: 600; border-radius: 99px; padding: 1px 8px; display: inline-flex; align-items: center; gap: 5px; }
.duty::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.duty.on { color: var(--positive); background: color-mix(in srgb, var(--positive) 10%, var(--panel)); }
.duty.off { color: var(--muted); background: var(--pill); }
.member-owner { font-size: 12px; color: var(--muted); }
.presence { border: 1px solid var(--line); border-radius: 99px; padding: 3px 8px; font-size: 11px; font-weight: 500; background: none; }
.presence.available { color: var(--positive); border-color: color-mix(in srgb, var(--positive) 20%, var(--line)); }
.presence.away { color: var(--side-muted); }
.intent-field { flex: 0 1 260px; }
.intent-field select { border: 0; background: transparent; color: inherit; font: inherit; padding: 4px 0; flex: 1; min-width: 0; outline: none; }
.compose-row .subject { flex: 1 1 260px; }
.pill.intent-build { background: rgba(59, 130, 246, .14); color: var(--info); }
.pill.intent-operate { background: rgba(239, 68, 68, .14); color: var(--negative); }
.pill.approval-pending { background: rgba(245, 158, 11, .18); color: var(--warning); }
.pill.approval-approved { background: rgba(34, 197, 94, .14); color: var(--positive); }
.pill.approval-denied { background: var(--pill); color: var(--muted); text-decoration: line-through; }
.req-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }

@media (max-width: 800px) {
  .composer:not(:focus-within) .intent-field { display: none; }
  .sofi-overlay { padding: 40px 16px 24px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* New message page: the composer becomes the page. */
.composer.page-mode { flex: 1; width: 100%; min-height: 0; margin: 0; overflow-y: auto; background: var(--panel); padding: 32px; align-items: stretch; }
.composer.page-mode > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; flex-shrink: 0; }
.composer.page-mode .compose-body { flex-direction: column; align-items: stretch; }
.composer.page-mode .compose-body textarea { min-height: 260px; }
.composer.page-mode .compose-body .btn { align-self: flex-end; min-width: 120px; }
.composer.page-mode .field, .composer.page-mode .subject, .composer.page-mode textarea { background: var(--panel); }
.composer.page-mode .small-field, .composer.page-mode .intent-field { display: flex !important; }
.composer.page-mode .subject { display: block !important; }
.compose-intro h2 { margin: 0 0 8px; font-size: 23px; font-weight: 600; letter-spacing: -.04em; }
.compose-intro p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.composer.page-mode .to-field { flex-basis: 100%; }
.composer.page-mode .small-field { flex: 1 1 calc(50% - 4px); }

/* Reply box vs New message page */
.reply-context { display: none; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 0 2px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font-weight: 500; font-size: 11px; }
.link-btn:hover { text-decoration: underline; }
.composer.reply-mode .reply-context { display: flex; }
.composer.reply-mode .compose-intro,
.composer.reply-mode #row-subject,
.composer.reply-mode .project-field,
.composer.reply-mode .thread-field { display: none !important; }
.composer.reply-mode #row-people { display: none; }
.composer.reply-mode.people-open #row-people { display: flex; }
.composer.reply-mode .to-field { flex-basis: 100%; }
.composer:not(.page-mode) .compose-intro { display: none; }
.composer.page-mode .reply-context { display: none; }
.send-group { display: flex; gap: 8px; align-items: center; }
.composer.page-mode .send-group { align-self: flex-end; }
.intent-select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px; }
.reply-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; border-radius: 5px; padding: 3px 0; font-size: 11px; font-weight: 500; color: var(--link); }
.reply-btn:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 800px) {
  .composer.page-mode { padding: 24px 16px; }
  .send-group { flex-direction: column-reverse; align-items: stretch; }
}

/* One message card: text on top, a slim toolbar inside the same box. */
.compose-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.compose-card:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent); }
.compose-card textarea { border: 0 !important; outline: none !important; background: transparent !important; resize: none; padding: 16px 16px 8px; min-height: 66px; max-height: 40vh; width: 100%; font: inherit; color: var(--text); }
.composer.page-mode .compose-card textarea { min-height: 240px; }
.compose-toolbar { display: flex; align-items: center; gap: 10px; padding: 6px 10px 10px; }
.intent-seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 2px; flex: none; }
.intent-seg button { border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 500; padding: 4px 9px; border-radius: 5px; }
.intent-seg button[aria-checked="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.composer.is-request .intent-seg button[aria-checked="true"] { color: var(--info); }
.intent-seg button[data-intent="operate"][aria-checked="true"] { color: var(--negative); }
.intent-hint { flex: 1; min-width: 0; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer.needs-approval .intent-hint { color: var(--warning); }
.send-btn { padding: 6px 15px; margin-left: auto; font-size: 12px; }

@media (max-width: 800px) {
  .intent-hint { display: none; }
  .composer.is-request .intent-hint { display: block; white-space: normal; flex-basis: 100%; order: 1; overflow-wrap: anywhere; }
  .compose-toolbar { flex-wrap: wrap; }
}

/* Sidebar organization: collapsible projects, pins, context menu */
.project-row { display: flex; align-items: center; }
.project-row .nav-item { flex: 1; min-width: 0; }
.chev { background: none; border: 0; color: var(--side-muted); width: 18px; padding: 0; font-size: 11px; flex: none; }
.chev:hover { color: var(--side-text); }
.nav-item { position: relative; }
.nav-more { display: none; margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; padding: 0 4px; font-size: 14px; line-height: 1; border-radius: 4px; }
.nav-more:hover { opacity: 1; background: var(--hover); }
.nav-item:hover .nav-more, .nav-item:focus-within .nav-more { display: inline-block; }
.nav-item:hover .count, .nav-item:focus-within .count { display: none; }
@media (hover: none) { .nav-more { display: inline-block; } }
.more-link { color: var(--side-muted) !important; font-size: 12.5px !important; }
.pin-icon { color: var(--side-muted); width: 14px; text-align: center; }
.menu { position: fixed; z-index: 90; min-width: 190px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.menu-item { background: none; border: 0; text-align: left; padding: 7px 10px; border-radius: 6px; font-size: 13.5px; color: var(--text); }
.menu-item:hover, .menu-item:focus { background: var(--hover); outline: none; }
.menu-item.danger { color: var(--danger); }
.chev { font-size: 0; width: 20px; height: 22px; display: grid; place-items: center; }
.chev::before { content: ''; display: block; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s ease; }
.chev[aria-expanded="true"]::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .chev::before { transition: none; } }

/* Home: where to pick up */
.home { gap: 12px; }
.home-head { margin-top: 12px; }
.home-head h2 { font-size: 15px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; letter-spacing: -0.01em; }
.home-head p { margin: 2px 0 0; }
.home-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.home-count { font-size: 11px; font-weight: 600; background: var(--pill); color: var(--muted); border-radius: 99px; padding: 1px 8px; }
.home-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.home-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.home-row .avatar.sm { margin-right: 4px; }
.home-preview { color: var(--muted); font-size: 13.5px; max-height: 4.8em; overflow: hidden; }
.home-preview p { margin: 0; }
.home-clear { text-align: center; padding: 48px 16px; }
.home-clear h2 { font-size: 20px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.02em; }
.digest { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.digest-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.digest-row:first-child { border-top: 0; }
.digest-row:hover { background: var(--hover); }
.digest-count { font-size: 12px; font-weight: 600; background: var(--pill); border-radius: 99px; text-align: center; padding: 1px 0; }
.digest-main { min-width: 0; display: flex; flex-direction: column; }
.digest-latest { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.digest-extras { margin: 4px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.home-agents { display: flex; flex-wrap: wrap; gap: 8px; }
.home-agent { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px 4px 4px; text-decoration: none; color: inherit; font-size: 13px; }
.home-agent:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }

/* Project and Thread pickers */
.picker-host { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 4px; max-height: 280px; overflow-y: auto; }
.picker-option { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.picker-option.active { background: var(--hover); }
.picker-label { font-size: 13.5px; font-weight: 500; color: var(--text); }
.picker-sub { font-size: 11.5px; color: var(--muted); }
.picker-option.create { flex-direction: row; align-items: center; gap: 8px; border-top: 1px solid var(--line); margin-top: 2px; border-radius: 0 0 7px 7px; color: var(--text); font-size: 13px; font-weight: 500; }
.picker-option.create:first-child { border-top: 0; margin-top: 0; border-radius: 7px; }
.picker-plus { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--pill); font-weight: 700; flex: none; }
.picker-empty { padding: 8px 10px; font-size: 12.5px; color: var(--muted); }
.picker-empty:empty { display: none; }
input.picked-new { font-style: italic; }
.composer.page-mode .field input::placeholder { color: var(--muted); }

/* ------------------------------------------------------ profile panel */
/* A teammate's profile docked on the right (FabiCrew's pattern, La Sala's look). */
.avatar.xl { width: 88px; height: 88px; border-radius: 24px; font-size: 28px; }
.avatar { position: relative; }
.avatar.has-photo { background: var(--hover); padding: 0; }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
/* Agent or human at a glance: humans are round, AI teammates are rounded
   squares with a small AI tag. */
.avatar.human { border-radius: 50%; }
.avatar.agent::after { content: 'AI'; position: absolute; right: -4px; bottom: -4px; font: 700 7.5px/1 var(--font); letter-spacing: .02em; padding: 2px 3px; border-radius: 4px; background: var(--text); color: var(--panel); border: 1.5px solid var(--panel); }
.avatar.sm.agent::after { font-size: 6.5px; padding: 1.5px 2px; right: -4px; bottom: -4px; }
.avatar.lg.agent::after { font-size: 9px; padding: 2px 4px; }
.avatar.xl.agent::after { font-size: 11px; padding: 3px 6px; right: -6px; bottom: -6px; border-radius: 6px; border-width: 2px; }
.kind-pill.ai { background: var(--text); color: var(--panel); }
.rail.profile { width: 360px; padding: 0; }
.rail.profile .close { position: absolute; right: 14px; top: 12px; float: none; z-index: 2; width: 30px; height: 30px; border-radius: 8px; }
.rail.profile .close:hover { background: var(--hover); color: var(--text); }
@media (min-width: 1101px) { .rail.profile { position: relative; } }
.pr-head { text-align: center; padding: 28px 22px 18px; border-bottom: 1px solid var(--line); }
.pr-photo { position: relative; width: 120px; margin: 0 auto 4px; }
.pr-photo .avatar { margin: 0 auto; }
.pr-photo-btn { display: block; margin: 12px auto 0; white-space: nowrap; font-size: 11px; font-weight: 500; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); box-shadow: var(--shadow); opacity: 0; transition: opacity .15s ease; }
.pr-photo:hover .pr-photo-btn, .pr-photo-btn:focus-visible, .pr-photo .avatar:not(.has-photo) + .pr-photo-btn { opacity: 1; }
.pr-photo-btn:hover { color: var(--text); border-color: var(--accent); }
.rail .pr-name { font-size: 18px; margin: 10px 0 2px; }
.pr-role { color: var(--muted); font-size: 13px; line-height: 1.45; }
.pr-badges { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.pr-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.pr-tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.pr-tab { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 11px 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.pr-tab:hover { color: var(--text); }
.pr-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.pr-body { padding: 4px 22px 28px; }
.pr-group { padding: 16px 0; border-bottom: 1px solid var(--line); }
.pr-group:last-child { border-bottom: 0; }
.pr-group h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.pr-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; font-size: 13px; padding: 3px 0; }
.pr-k { color: var(--muted); }
.pr-v { overflow-wrap: anywhere; }
.pr-v .link-btn { font: inherit; padding: 0; background: none; border: 0; }
.pr-v a, .pr-v .link-btn { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.pr-text { margin: 0; font-size: 13.5px; line-height: 1.6; }
.pr-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.pr-empty, .pr-note { color: var(--muted); font-size: 13px; margin: 16px 0; }
.pr-people { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; }
.pr-person { display: flex; align-items: center; gap: 10px; background: none; border: 1px solid transparent; border-radius: 10px; padding: 8px; text-align: left; color: var(--text); }
.pr-person:hover { background: var(--hover); }
.pr-person-b { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 800px) { .rail.profile { width: min(100%, 380px); } }

/* Your own card in the sidebar opens your profile */
.me .me-avatar { padding: 0; border-radius: 9px; }
.me .who { text-align: left; color: var(--text); font-size: 11.5px; padding: 2px 4px; margin-left: -4px; border-radius: 6px; }
.me .who:hover { background: var(--hover); }

/* Team page: grouping */
.team-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--hover); border-radius: 10px; }
.seg button { background: none; border: 0; border-radius: 7px; padding: 5px 11px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.section-count { font-family: var(--font); font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.member-card { cursor: pointer; transition: border-color .15s ease, transform .15s ease; }

/* Pictures: logo and photo editors */
.logo-row, .photo-row { display: flex; gap: 16px; align-items: center; }
.photo-row { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.logo-row h3 { margin: 0 0 2px; }
.logo-row p, .photo-row p { margin: 2px 0 8px; }
.logo-preview { width: 64px; height: 64px; flex: none; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.logo-preview img { max-width: 80%; max-height: 80%; object-fit: contain; }
.brand > img.uploaded { object-fit: contain; border-radius: 7px; }

/* ------------------------------------------------------------ motion */
/* Pages settle in instead of popping: a short fade and a few pixels of
   rise, with lists arriving a beat apart. Only on navigation (the page and
   stream get .quiet shortly after), never on live updates. Off entirely for
   people who ask for reduced motion. */
@keyframes sala-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sala-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sala-slide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes sala-pop { from { opacity: 0; transform: translateY(4px) scale(.985); } to { opacity: 1; transform: none; } }
:root { --ease-out: cubic-bezier(.2, .8, .2, 1); }
#app:not([hidden]) { animation: sala-fade .35s ease both; }
.page:not(.quiet) .page-inner > * { animation: sala-rise .34s var(--ease-out) both; }
.page:not(.quiet) .page-inner > :nth-child(2) { animation-delay: 35ms; }
.page:not(.quiet) .page-inner > :nth-child(3) { animation-delay: 70ms; }
.page:not(.quiet) .page-inner > :nth-child(4) { animation-delay: 105ms; }
.page:not(.quiet) .page-inner > :nth-child(5) { animation-delay: 140ms; }
.page:not(.quiet) .page-inner > :nth-child(n+6) { animation-delay: 170ms; }
.page:not(.quiet) .member-grid > *, .page:not(.quiet) .steps > * { animation: sala-rise .34s var(--ease-out) both; animation-delay: 90ms; }
.page:not(.quiet) .member-grid > :nth-child(2), .page:not(.quiet) .steps > :nth-child(2) { animation-delay: 115ms; }
.page:not(.quiet) .member-grid > :nth-child(3), .page:not(.quiet) .steps > :nth-child(3) { animation-delay: 140ms; }
.page:not(.quiet) .member-grid > :nth-child(4), .page:not(.quiet) .steps > :nth-child(4) { animation-delay: 165ms; }
.page:not(.quiet) .member-grid > :nth-child(n+5) { animation-delay: 190ms; }
.page-loading { animation: sala-fade .2s ease .25s both; }
.stream:not(.quiet) > * { animation: sala-fade .28s ease both; }
.stream:not(.quiet) > :nth-last-child(-n+5) { animation-name: sala-rise; animation-timing-function: var(--ease-out); }
.stream:not(.quiet) > :nth-last-child(2) { animation-delay: 30ms; }
.stream:not(.quiet) > :nth-last-child(1) { animation-delay: 60ms; }
.rail.entering { animation: sala-slide .26s var(--ease-out) both; }
.pr-body { animation: sala-fade .2s ease both; }
.modal-wrap { animation: sala-fade .16s ease both; }
.modal { animation: sala-pop .22s var(--ease-out) both; }
.toast { animation: sala-pop .2s var(--ease-out) both; }
.picker-list:not([hidden]) { animation: sala-pop .14s var(--ease-out) both; }
.member-card:hover { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .member-card:hover { transform: none; }
}

/* Selects outside a form field (side cards: Transfer, Hand over the Sala) */
.card > select { appearance: none; -webkit-appearance: none; width: 100%; font: inherit; font-size: 13.5px; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 32px 8px 10px; background-color: var(--bg);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.card > select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* Sign-in: Google, or an emailed code */
.splash-card .btn-block { width: 100%; justify-content: center; }
.signin-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 4px 0 14px; }
.signin-or::before, .signin-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.signin-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.signin-form input { font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); text-align: center; }
.signin-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.splash-card .signin-sent { color: var(--text); font-size: 13.5px; margin: 0 0 12px; }
.signin-failed .splash { min-height: 100vh; }

/* La Sala's mark (Dibu's "In Conversation" app icon) is a full-bleed square:
   round it wherever it appears. Uploaded Sala logos keep their own shape. */
#brand-logo:not(.uploaded), .splash-mark { border-radius: 22%; }
.ws-logo img[src$="la-sala-icon.png"] { width: 100%; height: 100%; object-fit: cover; }
.logo-preview img[src$="la-sala-icon.png"] { max-width: 100%; max-height: 100%; border-radius: 22%; }

/* Where an AI teammate runs: a small platform logo in the avatar's top corner */
.avatar .platform-dot { position: absolute; top: -4px; right: -4px; width: 15px; height: 15px; border-radius: 50%; background: var(--panel); box-shadow: 0 0 0 1.5px var(--panel), 0 0 0 2.5px var(--line); overflow: hidden; }
.avatar .platform-dot img { width: 100%; height: 100%; display: block; object-fit: cover; }
.avatar.sm .platform-dot { width: 12px; height: 12px; top: -3px; right: -3px; }
.avatar.lg .platform-dot { width: 20px; height: 20px; }
.avatar.xl .platform-dot { width: 28px; height: 28px; top: -6px; right: -6px; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--line); }

/* Is it listening? */
.listen { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: var(--pill); color: var(--muted); white-space: nowrap; }
.listen::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.listen.on { color: var(--positive); background: color-mix(in srgb, var(--positive) 12%, var(--panel)); }
.listen.idle { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, var(--panel)); }
.listen.off { color: var(--muted); }
.delivered { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.delivered.all { color: var(--positive); }

/* Local copy banner (SALA_AUTH=local only) */
.local-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 70; background: var(--warning); color: #fff; font-size: 12.5px; font-weight: 500; text-align: center; padding: 5px 12px; }
.local-banner a { color: #fff; text-decoration: underline; }
body.is-local .app { height: calc(100dvh - 28px); margin-top: 28px; }
