/* ===========================================================================
   BASED OPS — view styles, in the STUDIO language.
   Separate rounded cards with gaps. Coloured figures. Tan labels.
   =========================================================================== */

/* Colour utilities — one saturated hue per meaning, as STUDIO does it. */
.c-gold   { color: var(--gold-soft); }
.c-blue   { color: var(--blue-lt); }
.c-green  { color: var(--green); }
.c-yellow { color: var(--yellow); }
.c-pink   { color: var(--pink); }
.c-coral  { color: var(--coral); }
.c-white  { color: var(--ink); }
.c-grey   { color: var(--grey); }

/* ---------------------------------------------------------------------------
   NAV RIGHT — the actor chip
   --------------------------------------------------------------------------- */
.whochip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 11px 0 5px;
  background: #15171A;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  cursor: pointer;
  transition: background 120ms ease;
}
.whochip:hover { background: #1D2025; }
.whochip .chev { color: var(--tan); }

.avatar {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--gold), #8a6a1e);
  color: #17130A;
  font-size: 12px;
  font-weight: 800;
}
.avatar.asst { background: linear-gradient(140deg, var(--blue-lt), #2c4fae); color: #06101f; }

.who-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.who-text > span:first-child { font-size: 13px; font-weight: 600; }
.who-role { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tan); }

/* ---------------------------------------------------------------------------
   AUTH
   --------------------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 30%, rgba(210, 173, 73, .08), transparent 26rem),
    var(--ground);
}
.auth-card {
  width: min(100%, 430px);
  padding: 42px;
  background: #1A1D21;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(0,0,0,.42);
}
.auth-logo { display: block; width: 112px; margin: 0 auto 36px; }
.eyebrow { margin: 0 0 7px; color: var(--gold-soft); text-transform: uppercase; letter-spacing: .15em; font-size: 10px; font-weight: 800; }
.auth-card h1 { margin: 6px 0 14px; font-size: 38px; line-height: 1.05; letter-spacing: -.045em; }
.auth-card h1 em { color: var(--gold-soft); font-style: normal; }
.auth-copy { margin: 0 0 28px; color: var(--tan); line-height: 1.6; }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-form .field { display: flex; flex-direction: column; gap: 7px; }
.auth-form .btn { justify-content: center; }
.form-error { min-height: 18px; margin: 0; color: var(--coral); font-size: 12px; }

/* ---------------------------------------------------------------------------
   LAYOUT PRIMITIVES
   --------------------------------------------------------------------------- */
.grid { display: grid; gap: 16px; }
.row  { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col  { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.spacer { margin-left: auto; }
.section { margin-bottom: 10px; }

/* ---------------------------------------------------------------------------
   SCOREBOARD — STUDIO's stat card: label row, big coloured figure, sub-line.
   --------------------------------------------------------------------------- */
.score {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.stat:hover { border-color: var(--gold-edge); transform: translateY(-1px); }
.stat .k { display: flex; align-items: center; gap: 7px; }
.stat .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.stat .v { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.stat .foot { font-size: 11.5px; color: var(--tan); }
.stat.alert { border-color: rgba(255, 95, 126, 0.4); }

/* ---------------------------------------------------------------------------
   CALL TYPE COLOUR — one variable, set wherever a data-kind lands.
   --------------------------------------------------------------------------- */
[data-kind="creator"]  { --k: var(--blue-lt); }
[data-kind="brand"]    { --k: var(--coral); }
[data-kind="agency"]   { --k: var(--yellow); }
[data-kind="internal"] { --k: var(--grey); }
[data-kind="privacy"]  { --k: var(--pink); }

/* ---------------------------------------------------------------------------
   AGENDA — the day's calls as rows (Today tab)
   --------------------------------------------------------------------------- */
.agrow {
  display: grid;
  grid-template-columns: 96px 3px minmax(0, 1fr) auto;
  gap: 0 14px;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 100ms ease;
}
.agrow + .agrow { border-top: 1px solid rgba(74, 74, 82, 0.22); }
.agrow:hover { background: rgba(255, 255, 255, 0.025); }
.ag-time { display: flex; flex-direction: column; gap: 2px; }
.ag-time b { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-time small { font-size: 10.5px; color: var(--tan); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-bar { align-self: stretch; min-height: 36px; border-radius: 999px; background: var(--k, var(--grey)); }
.ag-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ag-title { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.ag-who { font-size: 12.5px; font-weight: 600; color: var(--tan); }
.ag-side { display: flex; align-items: center; gap: 8px; color: var(--grey); }
.agrow.live { background: var(--gold-wash); box-shadow: inset 3px 0 0 var(--gold); }
.agrow.live .ag-time b { color: var(--gold); }
.agrow.past { opacity: 0.55; }

.nowline {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 18px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
}
.nowline::after { content: ""; flex: 1; height: 1px; background: rgba(255, 95, 126, 0.35); }
.nowline .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--coral); margin-left: 82px; flex: none; }

/* ---------------------------------------------------------------------------
   CALLS — week strip
   --------------------------------------------------------------------------- */
.calls-calendar {
  margin-bottom: 18px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(198, 174, 123, .08), rgba(255, 255, 255, .018) 42%);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.weekbar { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; }
.weeklabel { font-size: 15px; font-weight: 750; min-width: 230px; text-align: center; letter-spacing: -0.01em; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.day {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 11px 12px 12px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.day:hover { border-color: rgba(255, 255, 255, 0.22); }
.day[aria-pressed="true"] { border-color: var(--gold-edge); background: var(--gold-wash); }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.day .dow { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tan); }
.day .dnum { font-size: 20px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.day[aria-pressed="true"] .dnum { color: var(--gold); }
.day.today { border-color: rgba(210, 173, 73, .28); }
.day.today .dnum { color: var(--gold-soft); }
.day.today .dow::after { content: " · today"; color: var(--gold); letter-spacing: 0.04em; text-transform: none; }
.day-count { font-size: 11px; font-weight: 600; color: var(--tan); }
.day-list { display: flex; flex-direction: column; gap: 3px; margin-top: auto; }
.day-item { display: grid; grid-template-columns: 6px auto minmax(0, 1fr); gap: 6px; align-items: center; font-size: 11px; line-height: 1.3; }
.day-item i { width: 6px; height: 6px; border-radius: 50%; background: var(--k, var(--grey)); }
.day-item b { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.day-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #C9C9D1; }
.day-more { font-size: 10.5px; color: var(--tan-dim); }

/* Calls tab: show actual events rather than an invented duration grid. */
.call-week { margin-bottom: 0; }

/* Numbers: keep the working list wide while chat naming standards stay visible. */
.numbers-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(255px, 310px);
  gap: 16px;
  align-items: start;
}
.numbers-main { min-width: 0; }
.number-source-select { display: inline-block; min-width: 105px; }
.number-source-select .select { width: 100%; }
.number-source-note { display: block; width: 100%; margin-top: 5px; font-size: 11px; }
.chat-naming-legend { position: sticky; top: 18px; }
.chat-naming-legend .panel-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.chat-naming-legend .panel-body { display: flex; flex-direction: column; gap: 0; padding: 6px 16px; }
.chat-name-rule { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.chat-name-rule:last-child { border-bottom: 0; }
.chat-name-rule b { color: var(--gold-soft); font-size: 12px; letter-spacing: .01em; }
.chat-name-rule span { color: var(--tan); font-size: 12px; line-height: 1.4; }
.outreach-message-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.outreach-message-editor .textarea { width: 100%; resize: vertical; }
.call-week .day { min-height: 88px; padding: 13px 14px; gap: 10px; background: rgba(12, 12, 14, .58); }
.call-week .day-head { align-items: center; }
.call-week .day-count { margin-top: auto; color: var(--tan-dim); }
.call-week .day-count b { color: var(--ink); font-size: 12px; }
.call-week .day[aria-pressed="true"] .day-count { color: var(--gold-soft); }
.call-week .day[aria-pressed="true"] { box-shadow: inset 0 2px 0 var(--gold); }
.calls-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
  gap: 16px;
  align-items: start;
}
.calls-agenda-panel .panel-head { align-items: center; min-height: 70px; }
.calls-agenda-panel .panel-head h2,
.calls-sidebar .panel-head h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.calls-agenda-panel .eyebrow,
.calls-sidebar .eyebrow { margin-bottom: 4px; }
.agenda-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 750;
}
.agenda-count small { color: var(--tan-dim); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.calls-agenda { display: flex; flex-direction: column; gap: 9px; min-height: 0; padding: 12px; }
.call-agenda-card {
  display: grid;
  grid-template-columns: 84px 4px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  width: 100%;
  min-height: 88px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.call-agenda-card:hover {
  background: rgba(255, 255, 255, .055);
  border-color: rgba(255, 255, 255, .25);
  transform: translateY(-1px);
}
.call-agenda-card.past { opacity: .55; }
.call-agenda-time { color: var(--gold-soft); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.call-agenda-bar { align-self: stretch; border-radius: 99px; background: var(--k, var(--grey)); }
.call-agenda-main { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.call-agenda-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 750; }
.call-agenda-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tan); font-size: 12px; }
.call-agenda-meta em { color: var(--yellow); font-style: normal; }
.call-agenda-state { display: flex; align-items: center; gap: 10px; color: var(--grey); }

/* Legend pips (Call types panel). */
.pip { width: 100%; height: 3px; border-radius: 999px; background: var(--k, var(--grey)); }

/* Coming up */
.uprow {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; padding: 11px 18px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
}
.uprow + .uprow { border-top: 1px solid rgba(74, 74, 82, 0.22); }
.uprow:hover { background: rgba(255, 255, 255, 0.03); }
.up-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; background: var(--raised); border-left: 3px solid var(--k, var(--grey));
}
.up-date b { font-size: 15px; font-weight: 800; line-height: 1; }
.up-date small { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--tan); margin-top: 2px; }
.up-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.up-main .t { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uprow .chev { color: var(--grey); }

@media (max-width: 900px) {
  .calls-layout { grid-template-columns: 1fr; }
  .calls-sidebar { display: block; }
  .numbers-layout { grid-template-columns: 1fr; }
  .chat-naming-legend { position: static; }
  .outreach-message-editor { grid-template-columns: 1fr; }
  .outreach-message-editor .btn { width: 100%; }
}
@media (max-width: 620px) {
  .calls-calendar { padding: 10px; }
  .weeklabel { min-width: 0; font-size: 13px; }
  .weekbar { gap: 8px; }
  .call-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .call-week .day { min-height: 76px; }
  .call-agenda-card { grid-template-columns: 62px 3px minmax(0, 1fr) auto; gap: 10px; padding: 13px; }
  .call-agenda-time { font-size: 13px; }
  .call-agenda-meta { white-space: normal; }
}

/* Booking modal — start-time conflict */
.clashline { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--r); background: var(--st-hot-w); color: var(--st-hot); font-size: 12.5px; font-weight: 600; }
.clashline.ok { background: var(--st-good-w); color: var(--st-good); }

/* ---------------------------------------------------------------------------
   NOTES — the four intake destinations
   --------------------------------------------------------------------------- */
.intake-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.intake-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 18px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.intake-card:hover { border-color: var(--gold-edge); background: var(--gold-wash); transform: translateY(-1px); }
.intake-card[data-hue="gold"]   { box-shadow: inset 0 2px 0 var(--gold); }
.intake-card[data-hue="blue"]   { box-shadow: inset 0 2px 0 var(--blue-lt); }
.intake-card[data-hue="yellow"] { box-shadow: inset 0 2px 0 var(--yellow); }
.intake-card[data-hue="green"]  { box-shadow: inset 0 2px 0 var(--green); }
.intake-title { font-size: 15px; font-weight: 750; letter-spacing: -0.01em; }
.intake-sub { font-size: 12.5px; color: var(--tan); line-height: 1.55; flex: 1; }
.intake-go { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-soft); }
@media (max-width: 620px) {
  .intake-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   FILTER PILLS — STUDIO uses rounded pills, filled when active.
   --------------------------------------------------------------------------- */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.fbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--tan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.fbtn:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.2); }
.fbtn[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #17130A; }
.fbtn[aria-pressed="true"] .n { color: #17130A; opacity: 0.7; }
.fbtn .n { font-variant-numeric: tabular-nums; opacity: 0.65; }

/* ---------------------------------------------------------------------------
   OUTREACH cards
   --------------------------------------------------------------------------- */
.lookup { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.hint { font-size: 12px; color: var(--tan-dim); margin-top: 8px; line-height: 1.5; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ccard-status { display: flex; min-width: 126px; flex-direction: column; gap: 4px; }
.ccard-status .label { margin: 0; font-size: 9px; }
.ccard-status .select { height: 30px; padding: 0 26px 0 9px; font-size: 11px; }

/* ---------------------------------------------------------------------------
   TEAM WORKSPACE
   --------------------------------------------------------------------------- */
.stat.static { cursor: default; }
.stat.static:hover { transform: none; border-color: var(--line); }
.team-section { margin-top: 30px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.section-title h2 { margin: 0; font-size: 22px; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 13px; }
.portal-card {
  padding: 17px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.portal-card.inactive { opacity: .62; }
.portal-card-top { display: flex; align-items: center; gap: 11px; }
.portal-card-top h3 { margin: 0; font-size: 14px; }
.portal-card-top p { margin: 3px 0 0; color: var(--tan); font-size: 10px; }
.portal-metrics { display: flex; gap: 18px; margin: 18px 0 14px; color: var(--tan); font-size: 11px; }
.portal-metrics b { color: var(--ink); font-size: 15px; margin-right: 3px; }
.portal-actions { display: flex; gap: 7px; }
.team-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .65fr); gap: 18px; align-items: start; }
.team-side { display: flex; flex-direction: column; gap: 16px; margin-top: 30px; }
.task-board { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.task-lane { min-width: 210px; padding: 9px; border-radius: var(--r-card); background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.04); }
.task-lane > header { display: flex; justify-content: space-between; padding: 7px 6px 11px; color: var(--tan); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.task-lane > header b { color: var(--ink); }
.task-stack { display: flex; flex-direction: column; gap: 8px; }
.task-card { position: relative; padding: 13px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.task-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; background: var(--blue-lt); }
.task-card.high::before { background: var(--yellow); }.task-card.urgent::before, .task-card.overdue::before { background: var(--coral); }
.task-card h3 { margin: 10px 0 6px; font-size: 12px; line-height: 1.4; }
.task-card > p { margin: 0; color: var(--tan); font-size: 10.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.task-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.task-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--tan-dim); font-size: 9px; }
.latest-update { margin-top: 10px; padding: 8px; border-radius: 6px; color: #c9c9d1; background: rgba(255,255,255,.03); font-size: 9.5px; line-height: 1.45; }
.latest-update small { display: block; margin-top: 5px; color: var(--tan-dim); }
.task-complete { width: 100%; margin-top: 10px; padding: 7px; border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--tan); font-size: 9px; font-weight: 700; cursor: pointer; }
.task-complete:hover { color: var(--green); border-color: rgba(83,211,146,.35); }
.completed-stamp { display: block; margin-top: 10px; color: var(--green); font-size: 9px; }
.lane-empty { padding: 20px 8px; color: var(--tan-dim); text-align: center; font-size: 10px; }
.task-form-grid { grid-template-columns: 1fr 1fr 1fr; }
.loading-state { padding: 80px 20px; color: var(--tan); text-align: center; }

@media (max-width: 1100px) {
  .team-layout { grid-template-columns: 1fr; }
  .team-side { display: grid; grid-template-columns: 1fr; margin-top: 0; }
}
@media (max-width: 720px) {
  .auth-card { padding: 30px 24px; }.auth-card h1 { font-size: 36px; }
  .team-side { display: flex; }.task-form-grid { grid-template-columns: 1fr; }
  .portal-actions { flex-wrap: wrap; }
}
.ccard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 140ms ease;
}
.ccard:hover { border-color: rgba(255, 255, 255, 0.2); }
.ccard-top { display: flex; gap: 12px; padding: 16px 16px 12px; align-items: flex-start; }
.pfp {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 800;
  overflow: hidden;
  color: #0b0b0d;
}
.pfp img { width: 100%; height: 100%; object-fit: cover; }
/* Deterministic avatar colours, the way STUDIO tints each creator. */
.pfp.h0 { background: var(--blue-lt); }
.pfp.h1 { background: var(--pink); }
.pfp.h2 { background: var(--green); }
.pfp.h3 { background: var(--gold-soft); }
.pfp.h4 { background: var(--coral); }
.pfp.h5 { background: #A78BFA; }

.ccard .name { font-size: 14px; font-weight: 700; line-height: 1.25; }
.ccard .handle { font-size: 12px; color: var(--tan); margin-top: 2px; word-break: break-all; }
.ccard-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 16px 12px; gap: 10px; }
.ccard-stats .v { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ccard-stats .k { font-size: 9.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--tan); margin-top: 3px; }
.ccard-bio { padding: 0 16px 14px; font-size: 12.5px; color: var(--grey); line-height: 1.55; min-height: 32px; }
.numcell .input.sm { min-width: 0; width: 138px; padding: 4px 9px; height: 28px; }
.numcell .input.sm:placeholder-shown { border-style: dashed; }
.ccard-foot { margin-top: auto; padding: 12px 16px; border-top: 1px solid rgba(74, 74, 82, 0.22); display: flex; gap: 8px; align-items: center; }
.ccard-foot .btn:first-child { flex: 1; }

/* ---------------------------------------------------------------------------
   MODAL
   --------------------------------------------------------------------------- */
.scrim[hidden] { display: none; }
.scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6, 6, 8, 0.75);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: start center;
  padding: 7vh 20px 40px;
  overflow: auto;
}
.modal {
  width: min(640px, 100%);
  background: #101013;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  animation: riseIn 160ms ease-out both;
}
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; }
.modal-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; flex: 1; }
.modal-body { padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 9px;
  align-items: center;
}

/* ---------------------------------------------------------------------------
   TOASTS
   --------------------------------------------------------------------------- */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  background: #16171B;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--r);
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 500;
  max-width: 400px;
  animation: riseIn 160ms ease-out both;
}
.toast.warn { border-left-color: var(--yellow); }
.toast.hot  { border-left-color: var(--coral); }

/* ---------------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .notelist { max-height: 320px; }
}
@media (max-width: 900px) {
  .nav { gap: 10px; padding: 0 14px; }
  .who-text { display: none; }
  .view { padding: 22px 14px 60px; }
  .week { grid-template-columns: repeat(7, minmax(58px, 1fr)); }
  .weekbar { overflow-x: auto; }
  .calls-layout { grid-template-columns: 1fr; }
  .calls-agenda { min-height: 0; }
  .call-agenda-card { grid-template-columns: 62px 3px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .call-agenda-state { display: none; }
}

/* ── Role-based navigation visibility ──────────────────────────────────── */
body[data-role="ASSISTANT"] .owner-only { display: none !important; }
body:not([data-role="ASSISTANT"]) .member-only { display: none !important; }

/* My Work update forms */
.my-update { margin-top: 10px; }
.my-update .row { align-items: center; gap: 8px; }

/* Notes — filters, day groups, call log */
.notefilters { display: flex; gap: 8px; align-items: center; }
.notefilters .input.sm { flex: 1; min-width: 0; }
.notefilters .select { height: 30px; padding: 0 28px 0 10px; font-size: 12px; max-width: 170px; }
.calllog { padding: 12px 22px 14px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.cl-this { font-size: 13px; line-height: 1.6; margin-top: 4px; }
.cl-this b { font-weight: 700; }
.cl-sub { font-size: 12px; color: var(--tan); }
.clrow {
  display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; padding: 7px 0; border: 0; border-top: 1px dashed rgba(74, 74, 82, 0.3);
  background: none; color: inherit; text-align: left; font: inherit; font-size: 12.5px;
}
button.clrow { cursor: pointer; }
button.clrow:hover .cl-t { color: var(--gold-soft); }
.clrow.on .cl-t { color: var(--gold); }
.clrow .tnum { font-size: 12px; color: var(--tan); white-space: nowrap; }
.clrow .cl-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-weight: 600; }
.clrow .cl-t small { font-weight: 400; color: var(--grey); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===========================================================================
   MOBILE — phones and small tablets. Everything above here assumes a desk.
   =========================================================================== */
@media (max-width: 720px) {
  :root { --nav-h: 56px; }

  /* Shell: logo + horizontally scrollable tabs + compact right side. */
  .nav { gap: 8px; padding: 0 10px; overflow: visible; }
  .nav-logo img { height: 26px; }
  .nav-links {
    flex: 1; min-width: 0; margin: 0;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-item { height: 32px; padding: 0 10px; font-size: 12px; }
  .nav-right { gap: 6px; }
  .nav-right .btn { height: 32px; padding: 0 10px; font-size: 12px; }
  .whochip { padding: 0 8px; }

  /* Page frame and headers. */
  .view { padding: 16px 12px 80px; }
  .view-head { gap: 12px; margin-bottom: 16px; }
  .view-head h1 { font-size: 24px; }
  .view-head .sub { font-size: 12.5px; margin-top: 5px; }
  .view-head > .row { width: 100%; flex-wrap: wrap; gap: 8px; }
  .view-head > .row .btn { flex: 1 1 auto; justify-content: center; }
  .view-head .modepill { align-self: flex-start; }
  .grid, .view .grid[style] { grid-template-columns: minmax(0, 1fr) !important; gap: 12px; }
  .split, .team-layout { grid-template-columns: 1fr; gap: 12px; }
  .panel-head { flex-wrap: wrap; gap: 8px; }

  /* Filters scroll sideways instead of wrapping into a wall of chips. */
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-bottom: 12px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters .fbtn { flex: none; }
  .filters .input.sm { flex: 1 0 160px; }
  .segmented { flex: none; }

  /* Forms: no iOS zoom, stacked pairs, full-width buttons. */
  .input, .select, .textarea { font-size: 16px; }
  .input.sm { font-size: 15px; }
  .modal .row, .field + .row, form .row { flex-wrap: wrap; }
  .modal .row > .field, .modal .row > .field[style] { flex: 1 1 100% !important; }
  .btn.sm { height: 34px; }
  .lookup { grid-template-columns: minmax(0, 1fr); }
  .lookup .btn { width: 100%; justify-content: center; }
  .notefilters { flex-wrap: wrap; }
  .notefilters .select { max-width: none; width: 100%; }
  .notefilters .select-wrap { width: 100%; }

  /* Modals become full-height sheets. */
  .scrim { padding: 0; place-items: stretch; }
  .modal, .modal.wide { width: 100%; min-height: 100%; border-radius: 0; border-left: 0; border-right: 0; display: flex; flex-direction: column; }
  .modal-body { flex: 1; padding: 4px 16px 16px; }
  .modal-head { padding: 14px 16px 10px; }
  .modal-head h2 { font-size: 18px; }
  .modal-foot { position: sticky; bottom: 0; background: #101013; flex-wrap: wrap; padding: 12px 16px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
  .modal-foot .label { flex-basis: 100%; }

  /* Tables turn into stacked cards — no sideways scrolling to find the button. */
  .tbl-wrap { overflow: visible; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl td { padding: 3px 0; border: 0; width: auto; text-align: left; }
  .tbl td:empty { display: none; }
  .tbl td.r { text-align: left; padding-top: 8px; }
  .rowacts { justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
  .rowacts .btn { flex: 1 1 auto; justify-content: center; }
  .numcell .input.sm { width: 100%; font-size: 16px; height: 36px; }

  /* Numbers / Outreach cards. */
  .cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ccard-phone .row { flex-wrap: wrap; }
  .ccard-phone .input.sm, .ccard-phone .btn { width: 100%; }
  .ccard-foot { flex-wrap: wrap; }
  .ccard-foot .btn:first-child { flex: 1 1 100%; }

  /* Today agenda rows and call logs. */
  .agrow { grid-template-columns: 78px 3px minmax(0, 1fr); padding: 12px 14px; }
  .ag-side { display: none; }
  .ag-title { white-space: normal; }
  .nowline .dot { margin-left: 64px; }
  .clrow { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .calllog { padding: 10px 14px 12px; }
  .confrow { flex-wrap: wrap; }
  .confrow .btn { margin-left: 0; }

  /* Calendar strip. */
  .weekbar { justify-content: space-between; }
  .weeklabel { min-width: 0; font-size: 13px; }
  .week { grid-template-columns: repeat(7, minmax(44px, 1fr)); gap: 4px; }
  .day { padding: 8px 6px; min-height: 64px; gap: 3px; }
  .day .dnum { font-size: 16px; }
  .day .dow { font-size: 9px; letter-spacing: 0.08em; }
  .day.today .dow::after { content: ""; }
  .day-list, .day-count { display: none; }
  .day::after { content: ""; display: block; height: 4px; border-radius: 2px; margin-top: auto; }
  .day.has-calls::after, .day[data-n]:not([data-n="0"])::after { background: var(--gold); }
  .uprow { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 10px 14px; }

  /* Call Mode: one column you scroll, editor gets the room. */
  .callmode { grid-template-rows: 52px minmax(0, 1fr) auto; }
  .cm-top { padding: 0 10px; gap: 8px; }
  .cm-title { font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cm-top .chip, .cm-top .savedot { display: none; }
  .cm-body { display: flex; flex-direction: column; overflow: auto; -webkit-overflow-scrolling: touch; }
  .cm-ctx, .cm-flags, .cm-note { flex: none; max-height: none; overflow: visible; padding: 14px; }
  .cm-ctx { order: 2; border: 0; border-top: 1px solid var(--line-hard); }
  .cm-note { order: 1; }
  .cm-flags { order: 3; border: 0; border-top: 1px solid var(--line-hard); }
  .cm-editor { min-height: 46vh; }
  .cm-legend { flex-wrap: wrap; }
  .termgrid { grid-template-columns: 1fr 1fr; }
  .flaglist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .cm-foot { flex-wrap: wrap; gap: 8px; padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .cm-foot > .label { display: none; }
  .cm-foot .btn { flex: 1 1 auto; justify-content: center; }

  /* Team / My Work */
  .team-side { display: flex; flex-direction: column; }
  .task-form-grid { grid-template-columns: 1fr; }

  /* Status pop-over stays on screen. */
  .statuspop { left: 12px !important; right: 12px; width: auto; }
}

@media (max-width: 480px) {
  .view { padding: 12px 10px 80px; }
  .view-head h1 { font-size: 22px; }
  .ccard-stats { gap: 6px; }
  .ccard-stats .v { font-size: 14px; }
  .termgrid { grid-template-columns: 1fr; }
  .flaglist { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(7, minmax(38px, 1fr)); }
  .agrow { grid-template-columns: 66px 3px minmax(0, 1fr); gap: 0 10px; }
  .ag-time b { font-size: 13px; }
  .nowline .dot { margin-left: 52px; }
}

/* ===========================================================================
   MOBILE DRAWER — burger top-right on phones AND tablets (≤1024px); panel slides
   in from the right with account, every tab, and log out.
   =========================================================================== */
.nav-burger, .drawer, .drawer-scrim { display: none; }

@media (max-width: 1024px) {
  .nav { gap: 10px; padding: 0 6px 0 12px; }
  .nav-links { display: none !important; }
  .nav-logo { margin-right: auto; }
  .nav-burger { order: 99; margin-left: auto; }   /* last in the bar → top-right */
  .nav-right .whochip, .nav-right #logout-btn { display: none; }

  .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; padding: 0 10px; flex: none;
    border: 0; border-radius: var(--r); background: none; cursor: pointer;
  }
  .nav-burger span { display: block; height: 2px; border-radius: 2px; background: var(--ink); transition: transform 160ms ease, opacity 160ms ease; }
  .nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-burger.open span:nth-child(2) { opacity: 0; }
  .nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .drawer-scrim { display: block; position: fixed; inset: 0; z-index: 600; background: rgba(6, 6, 8, 0.7); backdrop-filter: blur(3px); }
  .drawer-scrim[hidden] { display: none; }
  .drawer {
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; right: 0; z-index: 601;
    width: min(320px, 86vw);
    background: #101013; border-left: 1px solid var(--line);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.6);
    transform: translateX(102%); transition: transform 200ms ease;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  }
  .drawer.open { transform: none; }
  .drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 16px 14px; border-bottom: 1px solid var(--line); }
  .drawer-head .avatar { width: 40px; height: 40px; font-size: 15px; flex: none; }
  .drawer-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .drawer-who b { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .drawer-who small { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tan); margin-top: 2px; }
  .drawer-close { width: 36px; height: 36px; border: 0; border-radius: var(--r); background: rgba(255, 255, 255, 0.05); color: var(--grey); font-size: 15px; cursor: pointer; }
  .drawer-links { display: flex; flex-direction: column; gap: 2px; padding: 10px; overflow: auto; flex: 1; }
  .drawer-links .nav-item { display: flex; width: 100%; height: 48px; padding: 0 14px; font-size: 15px; border-radius: var(--r); justify-content: flex-start; }
  .drawer-links .nav-item .count { margin-left: auto; }
  .drawer-links .nav-item[aria-current="page"] { box-shadow: inset -3px 0 0 var(--gold); }
  .drawer-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); }
  .drawer-foot .btn { width: 100%; justify-content: center; height: 44px; }
  body.drawer-open { overflow: hidden; }
}

/* ===========================================================================
   MOBILE CALENDAR — one row of seven compact days, then the day's calls.
   Overrides the two earlier, conflicting small-screen rule sets.
   =========================================================================== */
@media (max-width: 720px) {
  .calls-calendar { padding: 10px; margin-bottom: 12px; }
  .calls-calendar .weekbar { justify-content: space-between; gap: 6px; margin-bottom: 10px; }
  .calls-calendar .weeklabel { font-size: 13px; min-width: 0; flex: 1; text-align: center; }
  .calls-calendar .btn.icon { width: 36px; height: 36px; flex: none; }
  .week.call-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 0; }
  .call-week .day {
    min-height: 62px; padding: 8px 2px 7px; gap: 5px;
    align-items: center; text-align: center; border-radius: 10px;
  }
  .call-week .day::after { display: none; }
  .call-week .day-head { flex-direction: column; align-items: center; gap: 2px; width: 100%; }
  .call-week .day .dow { font-size: 9px; letter-spacing: 0.04em; }
  .call-week .day .dnum { font-size: 16px; }
  .call-week .day.today .dow::after { content: ""; }
  .call-week .day.today .dnum { color: var(--coral); }
  .call-week .day[aria-pressed="true"] .dnum { color: var(--gold); }
  /* The "3 calls" / "Open" text collapses to a small count pill. */
  .call-week .day-count { display: block; margin-top: 0; font-size: 0; line-height: 0; min-height: 16px; }
  .call-week .day-count b {
    display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px; background: var(--gold-wash); color: var(--gold-soft);
    font-size: 10px; line-height: 1; font-weight: 800;
  }
  .calls-layout { grid-template-columns: 1fr; gap: 12px; }
  .calls-sidebar { display: flex; flex-direction: column; gap: 12px; }
  .calls-agenda-panel .panel-head { min-height: 0; padding: 12px 14px; }
  .calls-agenda { padding: 8px; gap: 8px; }
  .call-agenda-card { grid-template-columns: 56px 3px minmax(0, 1fr); gap: 10px; padding: 12px; min-height: 0; }
  .call-agenda-time { font-size: 13px; }
  .call-agenda-state { display: none; }
  .call-agenda-title, .call-agenda-meta { white-space: normal; overflow: visible; }
  .call-agenda-main { gap: 4px; }
}
