/* The app rail: the right-hand side of every app — the assistant for THIS app, and the ways work comes in. */
.app.has-rail { grid-template-columns: 276px minmax(0, 1fr) 348px; }
body.fold .app.has-rail { grid-template-columns: 76px minmax(0, 1fr) 348px; }
.app.has-rail .canvas { display: none; }
.app.has-rail.rail-min { grid-template-columns: 276px minmax(0, 1fr) 64px; }
body.fold .app.has-rail.rail-min { grid-template-columns: 76px minmax(0, 1fr) 64px; }

.rail { min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 26px; background: rgba(255, 255, 255, .72); border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 24px 60px -40px rgba(74, 29, 87, .45); backdrop-filter: blur(18px); overflow: hidden; }
.rl-h { display: flex; align-items: center; gap: 10px; }
.rl-hface { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 8px 18px -10px rgba(74, 29, 87, .6); }
.rl-h div { flex: 1; min-width: 0; }
.rl-h b { display: block; font-size: 14.5px; line-height: 1.25; }
.rl-h small { display: block; font-size: 12px; color: var(--bc-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 10px; background: none; color: var(--bc-ink-3); cursor: pointer; }
.rl-x:hover { background: var(--bc-canvas); color: var(--bc-ink); }
.rl-x .bc-icon { width: 18px; height: 18px; }
.rl-ctx { padding: 9px 12px; border-radius: 14px; background: rgba(123, 92, 214, .08); font-size: 13px; line-height: 1.35; }
.rl-ctx small { display: block; font-size: 11.5px; font-weight: 600; color: var(--bc-plum); }
.rl-ctx b { font-weight: 500; }
.rl-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
.rl-way { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(31, 16, 38, .07); font: 600 12px/1.2 var(--bc-text); color: var(--bc-ink); cursor: pointer; text-align: center; }
.rl-way:hover { box-shadow: 0 0 0 1px rgba(123, 92, 214, .35), 0 10px 22px -16px rgba(74, 29, 87, .6); }
.rl-way:focus-within, .rl-way:focus-visible { outline: 2px solid var(--bc-plum); outline-offset: 2px; }
.rl-way .bc-icon { width: 22px; height: 22px; color: var(--bc-plum); }
.rl-thread { flex: 1; min-height: 120px; overflow-y: auto; display: grid; align-content: start; gap: 10px; padding: 4px 2px; }
.rl-m { display: flex; gap: 8px; align-items: flex-start; }
.rl-m.rl-me { justify-content: flex-end; }   /* rl-me, not "me": ws.css draws .me as a 30 px avatar circle */
.rl-face { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; }
.rl-b { max-width: 88%; padding: 9px 12px; border-radius: 16px 16px 16px 6px; background: #fff; box-shadow: 0 0 0 1px rgba(31, 16, 38, .05); font-size: 13.5px; line-height: 1.45; }
.rl-m.rl-me .rl-b { border-radius: 16px 16px 6px 16px; background: var(--bc-ink); color: #fff; box-shadow: none; }
.rl-b p { margin: 0; white-space: pre-wrap; }
.rl-b p + p { margin-top: 6px; }
.rl-note { font-size: 12.5px; color: var(--bc-ink-2); }
.rl-busy p { color: var(--bc-ink-3); }
.rl-file { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.rl-file img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.rl-file .bc-icon { width: 22px; height: 22px; }
.rl-file small { display: block; opacity: .7; font-size: 11.5px; }
.rl-f { display: flex; gap: 6px; align-items: flex-end; padding: 6px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px rgba(31, 16, 38, .1); }
.rl-f:focus-within { box-shadow: 0 0 0 2px var(--bc-plum); }
.rl-f textarea { flex: 1; min-width: 0; max-height: 140px; padding: 6px 8px; border: 0; background: none; resize: none; font: inherit; font-size: 14px; line-height: 1.4; outline: none; }
.rl-send { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 11px; background: var(--bc-ink); color: #fff; cursor: pointer; }
.rl-send[disabled] { opacity: .5; }
.rl-send .bc-icon { width: 18px; height: 18px; }
.rl-clear { align-self: center; padding: 0; border: 0; background: none; font-size: 12px; color: var(--bc-ink-3); cursor: pointer; }
.rl-open { display: grid; justify-items: center; gap: 8px; width: 100%; padding: 6px 0; border: 0; background: none; cursor: pointer; }
.rl-open img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff; }
.rl-open span { writing-mode: vertical-rl; transform: rotate(180deg); font: 600 12px/1 var(--bc-text); color: var(--bc-ink-2); }
.app.rail-min .rail { padding: 10px 6px; }

/* narrower screens: the rail becomes a panel over the page, opened from its folded tab */
@media (max-width: 1180px) {
  .app.has-rail, body.fold .app.has-rail, .app.has-rail.rail-min, body.fold .app.has-rail.rail-min { grid-template-columns: 276px minmax(0, 1fr); }
  .app.has-rail .rail { position: fixed; right: 12px; top: 12px; bottom: 12px; width: min(360px, calc(100vw - 24px)); z-index: 60; }
  .app.has-rail.rail-min .rail { top: auto; bottom: 16px; width: 64px; height: auto; }
  .app.has-rail.rail-min .rl-open span { display: none; }
}
@media (max-width: 900px) { .app.has-rail, body.fold .app.has-rail, .app.has-rail.rail-min { grid-template-columns: minmax(0, 1fr); } }

/* proposal cards an app offers (the person presses; a write the workspace cannot make yet is held) and a reply's stray number */
.rl-props { display: grid; gap: 6px; padding: 0 14px 10px; }
.rl-prop { display: grid; gap: 4px; padding: 10px 12px; border-radius: 14px; background: #FBF7FF; box-shadow: inset 0 0 0 1px #E6DCF2; }
.rl-prop small { font-size: 11px; font-weight: 600; color: var(--bc-plum); }
.rl-prop p { margin: 0; font-size: 13px; line-height: 1.4; }
.rl-prop-a { display: flex; gap: 6px; }
.rl-prop-go, .rl-prop-held { min-height: 32px; padding: 6px 12px; border: 0; border-radius: 10px; font: 600 12.5px/1.2 var(--bc-text); text-decoration: none; }
.rl-prop-go { background: var(--bc-plum-tint); color: var(--bc-plum); }
.rl-prop-held { position: relative; background: rgba(31, 16, 38, .05); color: var(--bc-ink-3); cursor: not-allowed; }
.rl-stray { padding: 0 2px; border-radius: 4px; background: #FBE7DC; color: #9A4B22; }
/* the server chat inside the rail (workspace/chat.js) */
.rl-held { padding: 0 14px 6px; }
.rl-held .rl-file { margin-bottom: 6px; }
.rl-cmp { flex: none; }
