/* ============================================================
   studio.css — Mokacreativestudio v3 "Aperture"

   Design language: iOS. Large titles, inset grouped lists, bottom
   sheets, a blurred tab bar, hairline separators. Dark, with the
   studio's amber and teal as tint colours.

   One system, three widths:
     phone   (<760px)   bottom tab bar · sheets · single column
     tablet  (760px+)   sidebar replaces the tab bar
     desktop (1200px+)  sidebar + contextual right panel
   ============================================================ */

:root {
  /* surfaces, layered the way iOS stacks them */
  --bg:        #0B0C0F;
  --surface:   #16181D;
  --surface-2: #1F2229;
  --surface-3: #292D36;
  --elevated:  #1A1D23;

  --sep: rgba(255,255,255,.085);

  --text:   #F2F3F5;
  --text-2: #A0A6B0;
  --text-3: #6E747E;

  --amber:  #F5A524;
  --amber-2:#FFC163;
  --teal:   #2DD4BF;
  --violet: #A78BFA;
  --blue:   #5AA7FF;
  --rose:   #FF6B72;
  --green:  #46D67F;
  --tint:   var(--amber);

  --r-row:   10px;
  --r-card:  14px;
  --r-lg:    20px;
  --r-sheet: 22px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;

  --tabbar-h: 52px;
  --header-h: 52px;
  --gutter: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --shadow-card:  0 1px 2px rgba(0,0,0,.30);
  --shadow-sheet: 0 -8px 40px rgba(0,0,0,.55);
  --shadow-pop:   0 12px 40px rgba(0,0,0,.55);

  /* --- legacy aliases: JS files still set these inline --- */
  --bg-deep:   var(--bg);
  --panel:     var(--surface);
  --panel-2:   var(--surface-2);
  --panel-3:   var(--surface-3);
  --line:      var(--sep);
  --line-soft: rgba(255,255,255,.05);
  --text-dim:  var(--text-2);
  --text-mute: var(--text-3);
  --amber-dim: #A8730F;
  --r-sm:      10px;
  --r:         14px;
}

/* ---------------- reset ---------------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: var(--tint); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }

/* ============================================================
   SHELL
   ============================================================ */
#app {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  grid-template-areas: "header" "main" "tabbar";
}

/* ---------------- app bar ---------------- */
.appbar {
  grid-area: header;
  position: sticky; top: 0; z-index: 40;
  padding-top: var(--safe-t);
  background: rgba(11,12,15,.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep);
}
.appbar-row {
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 var(--gutter);
}
.appbar .lead, .appbar .trail { display: flex; align-items: center; gap: 4px; flex: none; }
.appbar .center { flex: 1; min-width: 0; display: flex; justify-content: center; }
.appbar .title {
  font-size: 16px; font-weight: 640; letter-spacing: -.3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* workstream pill — the identity anchor */
.ws-pill {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 100%;
  padding: 5px 12px 5px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  border: .5px solid var(--sep);
  font-size: 14px; font-weight: 590; color: var(--text);
  transition: transform .12s, background .15s;
}
.ws-pill:active { transform: scale(.96); background: var(--surface-3); }
.ws-pill .glyph {
  width: 21px; height: 21px; flex: none;
  display: grid; place-items: center;
  border-radius: 6px; font-size: 12px;
  background: color-mix(in srgb, var(--wsc, #F5A524) 22%, transparent);
  color: var(--wsc, var(--amber));
}
.ws-pill .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-pill .caret { font-size: 9px; color: var(--text-3); flex: none; }

.bar-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 99px; color: var(--tint); font-size: 16px;
  transition: background .15s, transform .12s;
}
.bar-btn:hover { background: var(--surface-2); }
.bar-btn:active { transform: scale(.9); }
.bar-btn.plain { color: var(--text-2); }

.status-dots { display: flex; align-items: center; gap: 5px; }
.sdot { width: 7px; height: 7px; border-radius: 99px; background: var(--text-3); }
.sdot.ok   { background: var(--green); box-shadow: 0 0 7px -1px var(--green); }
.sdot.warn { background: var(--amber); }
.sdot.err  { background: var(--rose); }

/* ---------------- main ---------------- */
.main {
  grid-area: main; min-width: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(22px + var(--safe-b));
}

/* ---------------- tab bar ---------------- */
.tabbar {
  grid-area: tabbar;
  position: sticky; bottom: 0; z-index: 40;
  display: flex;
  padding-bottom: var(--safe-b);
  background: rgba(11,12,15,.86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep);
}
.tabbar button {
  flex: 1; height: var(--tabbar-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-3);
  font-size: 10px; font-weight: 560;
  position: relative;
}
.tabbar button .ic { font-size: 19px; line-height: 1; transition: transform .12s; }
.tabbar button.active { color: var(--tint); }
.tabbar button:active .ic { transform: scale(.88); }
.tabbar .badge {
  position: absolute; top: 5px; left: 50%; margin-left: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--rose); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

.sidebar { display: none; }
.aside { display: none; }

/* ============================================================
   PAGE PRIMITIVES
   ============================================================ */
.view { padding: 0 0 8px; }
.view.flush { padding: 0; }

.large-title { padding: 8px var(--gutter) 2px; }
.large-title .eyebrow {
  font-size: 13px; font-weight: 600; color: var(--text-3); margin-bottom: 2px;
}
.large-title h1 { font-size: 32px; font-weight: 730; letter-spacing: -.8px; line-height: 1.12; }
.large-title p { margin-top: 6px; font-size: 14px; color: var(--text-2); max-width: 62ch; }

.page-head {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 8px var(--gutter) 14px;
}
.page-head h1 { font-size: 30px; font-weight: 730; letter-spacing: -.7px; line-height: 1.15; }
.page-head p { margin-top: 5px; font-size: 14px; color: var(--text-2); max-width: 62ch; }
.page-head .spacer { flex: 1; }

.sec-head {
  padding: 22px var(--gutter) 7px;
  font-size: 12.5px; font-weight: 620; letter-spacing: .5px; text-transform: uppercase;
  color: var(--text-3);
  display: flex; align-items: baseline; gap: 8px;
}
.sec-head .side {
  margin-left: auto; text-transform: none; letter-spacing: 0;
  font-weight: 500; color: var(--text-3);
}

/* ---------------- inset grouped list ---------------- */
.list {
  margin: 0 var(--gutter);
  background: var(--surface);
  border-radius: var(--r-card);
  overflow: hidden;
}
.list + .list { margin-top: 18px; }

.lrow {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  min-height: 46px; padding: 10px 14px;
  position: relative; color: var(--text);
  transition: background .12s;
}
button.lrow:active, a.lrow:active { background: var(--surface-2); }
.lrow + .lrow::before {
  content: ""; position: absolute; top: 0; left: 14px; right: 0;
  border-top: .5px solid var(--sep);
}
.lrow.full + .lrow::before, .lrow + .lrow.full::before { left: 0; }
.lrow .glyph {
  width: 29px; height: 29px; flex: none;
  display: grid; place-items: center;
  border-radius: 7px; font-size: 14px;
  background: var(--surface-3); color: var(--text-2);
}
.lrow .glyph.tint { background: color-mix(in srgb, var(--tint) 20%, transparent); color: var(--tint); }
.lrow .txt { flex: 1; min-width: 0; }
.lrow .t {
  display: block;
  font-size: 15.5px; font-weight: 500; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lrow .s {
  display: block;
  font-size: 12.5px; color: var(--text-3); line-height: 1.35; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lrow .val { font-size: 14.5px; color: var(--text-3); flex: none; }
.lrow .chev { color: var(--text-3); font-size: 15px; flex: none; opacity: .55; }
.lrow.stacked { align-items: flex-start; }
.lrow.stacked .t, .lrow.stacked .s { white-space: normal; }

@supports not (background: color-mix(in srgb, red 10%, blue)) {
  .lrow .glyph.tint { background: var(--surface-3); color: var(--amber); }
  .ws-pill .glyph { background: var(--surface-3); }
}

/* ---------------- cards ---------------- */
.card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 15px;
  margin: 0 var(--gutter) 12px;
  box-shadow: var(--shadow-card);
}
.card.tight { padding: 11px 13px; margin-bottom: 8px; }
.card.flush { margin-left: 0; margin-right: 0; }
.card h3 { font-size: 16px; font-weight: 640; letter-spacing: -.2px; margin-bottom: 9px; }

.hero-card {
  margin: 0 var(--gutter) 12px;
  border-radius: var(--r-lg);
  padding: 16px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--wsc, #F5A524) 17%, var(--surface)), var(--surface) 62%);
  border: .5px solid color-mix(in srgb, var(--wsc, #F5A524) 26%, transparent);
}
.hero-card .kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  color: var(--wsc, var(--amber)); margin-bottom: 8px;
}
.hero-card .h { font-size: 19px; font-weight: 660; letter-spacing: -.4px; line-height: 1.25; }
.hero-card .sub { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }
@supports not (background: color-mix(in srgb, red 10%, blue)) {
  .hero-card { background: var(--surface-2); border-color: var(--sep); }
}

.stat { background: var(--surface); border-radius: var(--r-card); padding: 13px 14px; }
.stat .k {
  font-size: 11.5px; font-weight: 600; letter-spacing: .3px;
  text-transform: uppercase; color: var(--text-3);
}
.stat .v {
  font-size: 25px; font-weight: 700; letter-spacing: -.7px;
  margin-top: 3px; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.stat .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.grid { display: grid; gap: 10px; margin: 0 var(--gutter) 12px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.c3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.c4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid .card, .grid .stat { margin: 0; }
@media (min-width: 700px) {
  .grid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 17px;
  border-radius: 11px;
  background: var(--surface-2); color: var(--text);
  font-size: 15.5px; font-weight: 560; letter-spacing: -.1px;
  transition: transform .1s, background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.965); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: var(--tint); color: #16120A; font-weight: 640; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.teal { background: var(--teal); color: #062A26; font-weight: 620; }
.btn.danger { background: rgba(255,107,114,.15); color: var(--rose); }
.btn.ghost { background: transparent; color: var(--tint); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 14px; border-radius: 9px; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }

.actions { display: flex; gap: 9px; flex-wrap: wrap; padding: 0 var(--gutter); margin-bottom: 12px; }
.actions .btn { flex: 1; min-width: 130px; }

/* ---------------- forms ---------------- */
.f { display: block; margin-bottom: 14px; }
.f > span:first-child {
  display: block;
  font-size: 12.5px; font-weight: 600; letter-spacing: .2px;
  color: var(--text-3); margin-bottom: 6px;
}
.input {
  width: 100%;
  background: var(--surface-2);
  border: .5px solid transparent;
  border-radius: 10px; color: var(--text);
  padding: 11px 13px;
  font-size: 16px;              /* 16px keeps iOS from zooming on focus */
  outline: none;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
.input:focus { border-color: var(--tint); background: var(--surface); }
textarea.input { min-height: 84px; resize: vertical; line-height: 1.55; }
select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
                    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 34px;
}
input[type="color"].input { padding: 4px; height: 42px; }
.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.5; margin-top: 6px; }

/* ---------------- chips & tags ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 99px;
  background: var(--surface-2);
  font-size: 12px; font-weight: 550; color: var(--text-2);
  white-space: nowrap;
}
.chip .led { width: 6px; height: 6px; border-radius: 99px; background: currentColor; flex: none; }
.chip.ok   { color: var(--green); background: rgba(70,214,127,.12); }
.chip.warn { color: var(--amber); background: rgba(245,165,36,.13); }
.chip.err  { color: var(--rose);  background: rgba(255,107,114,.13); }
.chip.live { color: var(--rose);  background: rgba(255,107,114,.14); font-weight: 650; }
.chip.live .led { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2.5px 8px; border-radius: 7px;
  background: var(--surface-3);
  font-size: 11.5px; font-weight: 550; color: var(--text-2);
  white-space: nowrap;
}
.tag.amber { background: rgba(245,165,36,.15); color: var(--amber-2); }
.tag.teal  { background: rgba(45,212,191,.15); color: var(--teal); }
.tag.rose  { background: rgba(255,107,114,.15); color: var(--rose); }
.tag.plain { background: var(--surface-3); color: var(--text-2); }

.dim  { color: var(--text-2); }
.mute { color: var(--text-3); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }

/* ============================================================
   SHEETS — the app's modal idiom
   ============================================================ */
.sheet-back, .modal-back {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet, .modal {
  width: 100%; max-width: 560px; max-height: 88dvh;
  background: var(--elevated);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: var(--shadow-sheet);
  display: flex; flex-direction: column;
  padding-bottom: var(--safe-b);
  animation: slideUp .28s cubic-bezier(.32,.72,0,1);
  overflow: hidden;
}
@keyframes slideUp { from { transform: translateY(100%); } }
.sheet .grabber, .modal .grabber {
  width: 36px; height: 5px; border-radius: 99px;
  background: var(--surface-3); margin: 8px auto 2px; flex: none;
}
.sheet > header, .modal > header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px var(--gutter) 12px; flex: none;
}
.sheet > header h2, .modal > header h2 {
  font-size: 17px; font-weight: 650; letter-spacing: -.3px;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet > .content, .modal > .content {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 0 14px; flex: 1;
}
.sheet > .content > .list:first-child,
.modal > .content > .list:first-child { margin-top: 0; }
.sheet > footer, .modal > footer {
  display: flex; gap: 9px;
  padding: 11px var(--gutter);
  border-top: .5px solid var(--sep);
  background: var(--elevated); flex: none;
}
.sheet > footer .btn, .modal > footer .btn { flex: 1; }

@media (min-width: 760px) {
  .sheet-back, .modal-back { align-items: center; }
  .sheet, .modal {
    max-width: 620px; border-radius: var(--r-lg); max-height: 86dvh;
    margin: 0 20px;
    animation: pop .22s cubic-bezier(.32,.72,0,1);
  }
  .sheet.wide, .modal.wide { max-width: 940px; }
  .sheet .grabber, .modal .grabber { display: none; }
  .sheet > header, .modal > header { padding-top: 16px; }
  @keyframes pop { from { transform: scale(.96); opacity: 0; } }
}

/* ---------------- tabs & segmented ---------------- */
.tabs {
  display: flex; gap: 2px;
  margin: 0 var(--gutter) 14px;
  padding: 2px; background: var(--surface-2); border-radius: 9px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1; min-width: max-content;
  padding: 7px 12px; border-radius: 7px;
  font-size: 13.5px; font-weight: 560; color: var(--text-2);
  transition: background .15s, color .15s; white-space: nowrap;
}
.tab.active { background: var(--surface-3); color: var(--text); }

.segmented {
  display: flex; gap: 2px; padding: 2px;
  background: var(--surface-2); border-radius: 9px;
  margin: 0 var(--gutter) 12px;
}
.segmented button {
  flex: 1; padding: 6px 10px; border-radius: 7px;
  font-size: 13.5px; font-weight: 560; color: var(--text-2);
  transition: background .15s, color .15s;
}
.segmented button.active { background: var(--surface-3); color: var(--text); }

/* ============================================================
   AVATARS
   ============================================================ */
.av {
  flex: none; position: relative;
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 99px;
  font-family: var(--mono); font-weight: 600; font-size: 11px;
  color: #0E1013; overflow: hidden;
}
.av.sm { width: 24px; height: 24px; font-size: 9px; }
.av.lg { width: 40px; height: 40px; font-size: 14px; }
.av.xl { width: 72px; height: 72px; font-size: 24px; border-radius: 26px; }
.av span { position: relative; z-index: 1; }
.av.face { background: none; box-shadow: inset 0 0 0 .5px rgba(255,255,255,.13); }
.av.face svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ============================================================
   MEETING ROOM
   ============================================================ */
.chatwrap {
  display: flex; flex-direction: column;
  min-height: calc(100dvh - var(--header-h) - var(--tabbar-h) - var(--safe-t) - var(--safe-b));
}
.chatbar {
  display: flex; align-items: center; gap: 7px;
  padding: 9px var(--gutter);
  border-bottom: .5px solid var(--sep);
  overflow-x: auto; scrollbar-width: none; flex: none;
}
.chatbar::-webkit-scrollbar { display: none; }
.chatgoal {
  font-size: 12.5px; color: var(--text-3); max-width: 34ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.stream {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px var(--gutter) 8px;
  display: flex; flex-direction: column; gap: 16px;
}
.daysep {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-3); font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}
.daysep::before, .daysep::after { content: ""; flex: 1; border-top: .5px solid var(--sep); }

.msg { display: flex; gap: 10px; align-items: flex-start; animation: rise .22s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }
.msg .body { min-width: 0; flex: 1; }
.msg .who { display: flex; align-items: baseline; gap: 7px; margin-bottom: 4px; flex-wrap: wrap; }
.msg .who b { font-size: 14.5px; font-weight: 640; letter-spacing: -.2px; }
.msg .who .rl {
  font-size: 10.5px; font-weight: 600; letter-spacing: .3px;
  text-transform: uppercase; color: var(--text-3);
}
.msg .who time { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.bubble {
  background: var(--surface);
  border-radius: 4px 15px 15px 15px;
  padding: 11px 14px;
  font-size: 15px; line-height: 1.58;
  overflow-wrap: anywhere;
}
.bubble > *:first-child { margin-top: 0; }
.bubble > *:last-child { margin-bottom: 0; }
.bubble p { margin: 0 0 9px; }
.bubble ul, .bubble ol { margin: 0 0 9px; padding-left: 21px; }
.bubble li { margin-bottom: 3px; }
.bubble h4 { margin: 11px 0 6px; font-size: 14px; color: var(--amber-2); }
.bubble strong { color: #fff; font-weight: 640; }
.bubble code {
  font-family: var(--mono); font-size: .87em;
  background: var(--surface-3); color: var(--teal);
  padding: 1.5px 5px; border-radius: 5px;
}
.bubble pre {
  background: var(--bg); border: .5px solid var(--sep);
  border-radius: 10px; padding: 12px 13px;
  overflow-x: auto; margin: 0 0 9px; position: relative;
}
.bubble pre code { background: none; padding: 0; color: #C9D1D9; font-size: 12.5px; line-height: 1.6; }

.msg.ceo { flex-direction: row-reverse; }
.msg.ceo .body { display: flex; flex-direction: column; align-items: flex-end; }
.msg.ceo .who { flex-direction: row-reverse; }
.msg.ceo .who time { margin-left: 0; margin-right: auto; }
.msg.ceo .bubble {
  background: linear-gradient(160deg, #F5A524, #DA8E14);
  color: #17120A; border-radius: 15px 4px 15px 15px; max-width: 88%;
}
.msg.ceo .bubble code { background: rgba(0,0,0,.16); color: #17120A; }
.msg.ceo .bubble strong { color: #17120A; }

.msg.system { justify-content: center; }
.msg.system .body { flex: none; max-width: 90%; }
.msg.system .bubble {
  background: transparent; border: .5px dashed var(--sep);
  color: var(--text-3); font-size: 12px; text-align: center;
  border-radius: 99px; padding: 5px 14px;
}

.actions-applied { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 3px 0; }
.typing i {
  width: 6px; height: 6px; border-radius: 99px; background: var(--text-3);
  animation: blink 1.3s infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; } }

.composer {
  flex: none;
  border-top: .5px solid var(--sep);
  background: rgba(11,12,15,.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  padding: 9px var(--gutter) 10px;
  position: sticky; bottom: 0;
}
.speakerbar { margin-bottom: 9px; }
.speaker-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 7px; scrollbar-width: none; }
.speaker-strip::-webkit-scrollbar { display: none; }
.speaker-pill {
  flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 58px; opacity: .5;
  transition: opacity .15s, transform .1s;
}
.speaker-pill:active { transform: scale(.93); }
.speaker-pill .pn {
  font-size: 11px; font-weight: 560; color: var(--text);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.speaker-pill .pr, .speaker-pill .sug { display: none; }
.speaker-pill .av { box-shadow: inset 0 0 0 .5px rgba(255,255,255,.13); }
.speaker-pill.spoke { opacity: .28; }
.speaker-pill.suggested { opacity: 1; }
.speaker-pill.suggested .av { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--amber); }
.speaker-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.speaker-actions .btn { flex: 1; min-width: 118px; }

.composer .row { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea {
  flex: 1;
  background: var(--surface-2); border: .5px solid transparent;
  border-radius: 20px; padding: 10px 15px;
  font-size: 16px; line-height: 1.45;
  resize: none; outline: none; max-height: 170px;
  transition: border-color .15s;
}
.composer textarea:focus { border-color: var(--tint); }

/* ============================================================
   PIPELINE BOARD
   ============================================================ */
.board {
  display: flex; gap: 11px;
  overflow-x: auto; align-items: flex-start;
  padding: 2px var(--gutter) 12px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.col {
  flex: none; width: 252px; scroll-snap-align: start;
  background: var(--surface); border-radius: var(--r-card);
  display: flex; flex-direction: column;
  max-height: 68dvh; overflow: hidden;
}
.col > header {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 13px 9px;
  font-size: 13px; font-weight: 620; letter-spacing: -.1px;
  border-bottom: .5px solid var(--sep); flex: none;
}
.col > header .n {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  background: var(--surface-3); color: var(--text-2);
  padding: 1px 7px; border-radius: 99px;
}
.col .body { padding: 9px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.pcard {
  background: var(--surface-2); border-radius: 11px;
  padding: 11px 12px; cursor: pointer;
  transition: transform .1s, background .15s;
}
.pcard:hover { background: var(--surface-3); }
.pcard:active { transform: scale(.975); }
.pcard .t { font-size: 13.5px; font-weight: 560; line-height: 1.35; }
.pcard .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }

/* ============================================================
   MISC
   ============================================================ */
.minutes-item {
  padding: 9px 13px;
  border-left: 2.5px solid var(--surface-3);
  background: var(--surface);
  border-radius: 0 9px 9px 0;
  font-size: 14px; line-height: 1.5; margin-bottom: 7px;
}
.minutes-item .m { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.minutes-item.dec { border-left-color: var(--amber); }
.minutes-item.act { border-left-color: var(--teal); }
.minutes-item.q   { border-left-color: var(--violet); }

.memrow {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 11px; background: var(--surface);
  border-radius: 10px; margin-bottom: 6px;
}
.memrow.pin { background: rgba(245,165,36,.09); }
.memrow .txt { flex: 1; min-width: 0; }
.memrow .ts { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.roster-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 6px 10px; border-radius: 9px;
  transition: background .12s;
}
.roster-item:hover, .roster-item.active { background: var(--surface-2); }
.roster-item .nm { font-size: 13px; font-weight: 520; }
.roster-item .rl { font-size: 10.5px; color: var(--text-3); }
.roster-item .state { width: 6px; height: 6px; border-radius: 99px; margin-left: auto; flex: none; background: transparent; }
.roster-item .state.speaking { background: var(--amber); animation: pulse 1.2s infinite; }
.roster-item .state.next { background: var(--teal); }
.roster-item .state.done { background: var(--surface-3); }

.rl-inline {
  font-size: 10.5px; font-weight: 600; letter-spacing: .3px;
  text-transform: uppercase; color: var(--text-3);
}
.group-label {
  padding: 16px 10px 6px;
  font-size: 11px; font-weight: 650; letter-spacing: .6px;
  text-transform: uppercase; color: var(--text-3);
}

.empty { text-align: center; padding: 34px 24px; color: var(--text-3); }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .45; }
.empty .t { font-size: 15.5px; font-weight: 560; color: var(--text-2); }
.empty .s { font-size: 13.5px; margin-top: 5px; line-height: 1.5; }

/* ---------------- toasts ---------------- */
#toasts {
  position: fixed; z-index: 120;
  left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  pointer-events: none; padding: 0 var(--gutter);
}
.toast {
  background: var(--surface-3); color: var(--text);
  border-radius: 13px; padding: 11px 16px;
  font-size: 14px; font-weight: 520;
  box-shadow: var(--shadow-pop); max-width: 460px;
  animation: toastIn .25s cubic-bezier(.32,.72,0,1);
}
@keyframes toastIn { from { transform: translateY(14px); opacity: 0; } }
.toast.ok  { background: #14432A; color: #9BF0BC; }
.toast.err { background: #4A1F23; color: #FFB4B8; }

/* ============================================================
   TABLET — sidebar replaces the tab bar
   ============================================================ */
@media (min-width: 760px) {
  :root { --gutter: 20px; }

  #app {
    grid-template-columns: 252px minmax(0,1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "sidebar header" "sidebar main";
  }
  .tabbar { display: none; }

  .sidebar {
    grid-area: sidebar;
    display: flex; flex-direction: column;
    background: var(--surface);
    border-right: .5px solid var(--sep);
    padding: 0 10px 16px;
    overflow-y: auto;
    height: 100dvh; position: sticky; top: 0;
  }
  .brand { display: flex; align-items: center; gap: 9px; padding: 18px 8px 6px; }
  .brand .dot {
    width: 9px; height: 9px; border-radius: 99px;
    background: var(--amber); box-shadow: 0 0 12px -1px var(--amber);
  }
  .brand b { font-size: 14px; font-weight: 700; letter-spacing: -.2px; }
  .brand small { display: block; font-size: 10.5px; color: var(--text-3); }

  .navitem {
    display: flex; align-items: center; gap: 11px;
    width: 100%; text-align: left;
    padding: 8px 10px; margin-bottom: 2px; border-radius: 9px;
    color: var(--text-2); font-size: 14.5px; font-weight: 520;
    transition: background .12s, color .12s;
  }
  .navitem:hover { background: var(--surface-2); color: var(--text); }
  .navitem.active { background: var(--surface-3); color: var(--text); font-weight: 600; }
  .navitem .ic { width: 19px; text-align: center; font-size: 15px; }
  .navitem .count {
    margin-left: auto; font-family: var(--mono); font-size: 10.5px; font-weight: 700;
    background: var(--rose); color: #fff; padding: 1px 6px; border-radius: 99px;
  }

  .wsitem {
    display: flex; align-items: center; gap: 10px;
    width: 100%; text-align: left;
    padding: 7px 10px; margin-bottom: 2px; border-radius: 9px;
    color: var(--text-2);
    transition: background .12s, color .12s;
  }
  .wsitem:hover { background: var(--surface-2); }
  .wsitem.active { background: var(--surface-2); color: var(--text); }
  .wsitem .ic {
    width: 24px; height: 24px; flex: none;
    display: grid; place-items: center; border-radius: 7px; font-size: 12px;
    background: color-mix(in srgb, var(--wsc) 20%, transparent);
    color: var(--wsc);
  }
  .wsitem.active .ic { box-shadow: 0 0 11px -3px var(--wsc); }
  .wsitem .nm { font-size: 13px; font-weight: 550; line-height: 1.25; }
  .wsitem .rl { font-size: 10px; color: var(--text-3); }
  .wsitem .count {
    margin-left: auto; font-family: var(--mono); font-size: 10px;
    background: var(--surface-3); color: var(--text-2);
    padding: 1px 6px; border-radius: 99px;
  }
  @supports not (background: color-mix(in srgb, red 10%, blue)) {
    .wsitem .ic { background: var(--surface-3); }
  }

  .appbar { background: rgba(11,12,15,.75); }
  .appbar .center { justify-content: flex-start; }
  .ws-pill.in-bar { display: none; }

  .large-title h1 { font-size: 34px; }
  .stream { padding-left: 24px; padding-right: 24px; }
  .bubble { max-width: 78ch; }
  .col { max-height: calc(100dvh - 240px); }
  #toasts { bottom: 22px; }
  .chatwrap { min-height: calc(100dvh - var(--header-h)); }
  .view { max-width: 900px; }
}

/* ============================================================
   DESKTOP — contextual right panel
   ============================================================ */
@media (min-width: 1200px) {
  #app {
    grid-template-columns: 258px minmax(0,1fr) 322px;
    grid-template-areas: "sidebar header header" "sidebar main aside";
  }
  .aside {
    grid-area: aside; display: block;
    background: var(--surface);
    border-left: .5px solid var(--sep);
    padding: 16px 16px 34px;
    overflow-y: auto;
    height: calc(100dvh - var(--header-h));
    position: sticky; top: var(--header-h);
  }
  .aside section { margin-bottom: 20px; }
  .aside h4 {
    font-size: 11px; font-weight: 650; letter-spacing: .6px;
    text-transform: uppercase; color: var(--text-3); margin-bottom: 8px;
  }
  .aside .card, .aside .grid, .aside .list { margin-left: 0; margin-right: 0; }
  .aside .card { background: var(--surface-2); }
  .view { max-width: 1000px; }
}
