/* Studio chat widget — signed-in seats only. Sits at the bottom-right,
   just left of the Studio Desk badge when that badge is on the page. */

.sc-launch {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--badge, 56px);
  height: var(--badge, 56px);
  padding: 0;
  border: 1px solid #000;
  border-radius: 50%;
  background: #fff;
  color: #000;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}
.sc-launch__mark {
  display: grid;
  place-items: center;
  width: 72%;
  height: 72%;
}
/* The mark's file is white line work; on this white button it is turned to
   black, which also tells the private thread apart from the studio desk. */
.sc-launch__mark img { display: block; width: 100%; height: 100%; object-fit: contain; filter: invert(1); }
.sc-launch__n {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.25em;
  height: 1.25em;
  padding: 0 5px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font: 700 0.7rem/1.25em Inter, system-ui, sans-serif;
  text-align: center;
}
.sc-launch:hover { background: #ededed; }
.sc-launch:focus-visible { outline: 2px solid #000; outline-offset: 3px; }

.sc-panel {
  position: fixed;
  z-index: 92;
  right: var(--dock-gut, 16px);
  bottom: calc(var(--badge, 56px) + 26px + env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 24px));
  height: min(520px, calc(100vh - var(--badge, 56px) - 48px));
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #000;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
.sc-panel[hidden],
.sc-launch[hidden],
.sc[hidden] { display: none !important; }
body.sc-has-dock .sc-panel {
  right: calc(var(--dock-gut, 16px) + var(--badge, 56px) + 10px);
}
body.sc-solo .sc,
body.ib .sc {
  position: fixed;
  z-index: 92;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
body.sc-solo .sc-launch,
body.ib .sc-launch,
body.sc-solo .sc-panel,
body.ib .sc-panel { pointer-events: auto; }
body.sc-solo .sc-panel,
body.ib .sc-panel {
  position: relative;
  right: auto;
  bottom: auto;
  width: min(380px, calc(100vw - 32px));
}

.sc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px 14px;
  background: #000;
  color: #fff;
}
.sc-title {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.1;
}
.sc-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #bdbdbd;
}
.sc-live::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #767676;
}
.sc-live.is-live { color: #8fdf9e; }
.sc-live.is-live::before { background: #3dcc63; }
.sc-min {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.sc-min:hover { background: #fff; color: #000; }

.sc-people {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  border-bottom: 1px solid #ececec;
  background: #f8f8f8;
  font-size: 0.75rem;
}
.sc-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #5c5c5c;
}
.sc-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #c8c8c8;
}
.sc-person.is-on { color: #000; font-weight: 600; }
.sc-person.is-on .sc-dot { background: #1b7a3a; }
.sc-person.is-you .sc-person__n::after { content: " · you"; font-weight: 500; color: #767676; }
.sc-person__l { color: #767676; font-weight: 500; }

.sc-log {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow: auto;
  background:
    linear-gradient(to right, #fff 0, #fff 10px, #ececec 10px, #ececec 11px, #fff 11px);
}
.sc-empty { padding: 22px 16px 22px 22px; color: #5c5c5c; font-size: 0.9rem; }
.sc-line {
  padding: 10px 14px 10px 22px;
  border-bottom: 1px solid #f0f0f0;
}
.sc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 3px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5c5c5c;
}
.sc-who { color: #000; }
.sc-at { text-transform: none; letter-spacing: 0; font-weight: 500; }
.sc-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.95rem; line-height: 1.4; }
.sc-line.is-new { animation: sc-arrive 1s ease; }
@keyframes sc-arrive { from { background: #ececec; } to { background: transparent; } }

.sc-compose {
  display: grid;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid #e0e0e0;
  background: #fff;
}
.sc-ta {
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid #c8c8c8;
  border-radius: 8px;
  font: 1rem/1.4 Inter, system-ui, sans-serif;
  resize: none;
}
.sc-ta:focus { outline: 2px solid #000; border-color: #000; }
.sc-row { display: flex; align-items: center; gap: 10px; }
.sc-send {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.sc-send:hover { background: #262626; }
.sc-send[disabled] { opacity: 0.55; }
.sc-err { margin: 0; color: #c62828; font-size: 0.8rem; min-height: 1em; }
.sc-home {
  margin: 0;
  padding: 0 12px 10px;
  font-size: 0.72rem;
  color: #767676;
}
.sc-home a { color: #5c5c5c; }
.sc-word-open {
  border: 0;
  padding: 0;
  background: none;
  color: #5c5c5c;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sc-word[hidden] { display: none !important; }
.sc-word {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  border-top: 1px solid #ececec;
}
.sc-word__t { margin: 8px 0 0; font-weight: 700; font-size: 0.85rem; }
.sc-word__f { display: grid; gap: 3px; font-size: 0.78rem; font-weight: 600; }
.sc-word__hi { font-weight: 500; color: #767676; }
.sc-word__in {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid #c8c8c8;
  border-radius: 8px;
  font: 0.95rem/1.3 Inter, system-ui, sans-serif;
}
.sc-word__hint { margin: 0; font-size: 0.72rem; color: #767676; }
.sc-word__err { margin: 0; color: #c62828; font-size: 0.8rem; min-height: 1em; }
.sc-word-cancel {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #c8c8c8;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 420px) {
  body.sc-has-dock .sc-panel { right: var(--dock-gut, 10px); width: calc(100vw - 20px); }
}
