/*
 * Tecaudex Workspace design system.
 * Tokens lifted from the reference design: Inter at 15px, near-black ink on white,
 * a single crimson accent, pill controls, and 11px uppercase micro-labels.
 */

:root {
  --accent: #ed1a3b;
  --accent-ink: #ffffff;
  --accent-wash: #fff1f3;

  --ink: #201e1d;
  --ink-strong: #1b1b1b;
  --ink-mid: #4c4c4c;
  --ink-muted: #939393;

  --ground: #ffffff;
  --surface: #ffffff;
  --surface-sunk: #fafafa;
  --chip: #f1f1f1;
  --line: #ebebeb;
  --line-strong: #dcdcdc;

  --ok: #157347;
  --ok-wash: #e8f5ee;
  --warn: #9a6700;
  --warn-wash: #fff6e0;

  --radius: 10px;
  --radius-lg: 14px;
  --pill: 999px;

  --shell-pad: 2rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* Micro-typography ---------------------------------------------------------- */

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow--quiet { color: var(--ink-muted); }

.muted { color: var(--ink-muted); }
.tiny { font-size: 11px; }

.display {
  margin: 0;
  font-size: clamp(1.9rem, 1.2rem + 2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Shell --------------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem var(--shell-pad);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.masthead__crumb {
  color: var(--ink-muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.masthead__spacer { flex: 1; }

.masthead__search {
  flex: 0 1 26rem;
  min-width: 0;
}

.masthead__right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

/* The signed-in user chip */
.whoami {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}

.whoami__name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.whoami__role { color: var(--ink-muted); font-size: 11px; line-height: 1.2; }

.main {
  padding: 2rem var(--shell-pad) 4rem;
}

.main--wide { max-width: 78rem; margin: 0 inline; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

/* Avatars ------------------------------------------------------------------- */

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink-strong);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar--lg { width: 36px; height: 36px; font-size: 11px; }
.avatar--accent { background: var(--accent); }

/* Controls ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;

  &:hover { border-color: var(--ink-muted); }
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);

  &:hover { filter: brightness(1.06); border-color: var(--accent); }
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-mid);

  &:hover { background: var(--chip); border-color: transparent; }
}

.btn--sm { padding: 0.3rem 0.7rem; font-size: 11.5px; }
.btn--block { width: 100%; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-mid);
  cursor: pointer;

  &:hover { background: var(--chip); }
}

.icon-btn__dot {
  position: absolute;
  transform: translate(9px, -9px);
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: var(--pill);
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
}

.field-inline { position: relative; }

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;

  &::placeholder { color: var(--ink-muted); }

  &:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    border-color: var(--accent);
  }
}

/* Chips and badges ---------------------------------------------------------- */

.chip {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--pill);
  background: var(--chip);
  color: var(--ink-mid);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chip--ok { background: var(--ok-wash); color: var(--ok); }
.chip--warn { background: var(--warn-wash); color: var(--warn); }
.chip--accent { background: var(--accent-wash); color: var(--accent); }

/* Stat tiles ---------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.stat {
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.stat--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);

  & .stat__label { color: rgb(255 255 255 / 78%); }
}

.stat__value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat__label {
  margin-top: 0.15rem;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Data table ---------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  padding: 0 0.75rem 0.6rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr {
  transition: background 120ms ease;

  &:hover { background: var(--surface-sunk); }
}

.table td:first-child,
.table th:first-child { padding-left: 0; }

.table td:last-child,
.table th:last-child { padding-right: 0; text-align: right; }

.identity {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.identity__name { font-weight: 600; }

.identity__sub {
  color: var(--ink-muted);
  font-size: 11px;
}

.row-actions {
  display: inline-flex;
  gap: 0.35rem;
  justify-content: flex-end;
}

/* Module cards -------------------------------------------------------------- */

.modules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.85rem;
}

.module {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease;

  &:hover { border-color: var(--ink-muted); transform: translateY(-1px); }
}

.module__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 0.35rem;
  border-radius: 9px;
  background: var(--ink-strong);
  color: #fff;
}

.module__name { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }

.module__blurb {
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.module__cue {
  margin-top: auto;
  padding-top: 0.5rem;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Home layout --------------------------------------------------------------- */

.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

@media (width >= 62rem) {
  .home { grid-template-columns: minmax(0, 1fr) 21rem; }
}

.panel {
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.panel + .panel { margin-top: 0.85rem; }

.panel--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.panel__label {
  margin: 0 0 0.6rem;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel--accent .panel__label { color: rgb(255 255 255 / 78%); }

.feed { display: flex; flex-direction: column; gap: 0.85rem; }

.feed__item { display: flex; gap: 0.65rem; align-items: flex-start; }

.feed__empty { margin: 0; }

/* Hide the empty-state the moment the list holds a real item, so a row arriving over a
   Turbo Stream doesn't need a second broadcast just to clear the placeholder. */
.feed:has(.feed__item) .feed__empty { display: none; }

.feed__body { min-width: 0; font-size: 12.5px; line-height: 1.4; }

.feed__time { color: var(--ink-muted); font-size: 11px; }

.meter {
  height: 6px;
  margin: 0.5rem 0 0.4rem;
  border-radius: var(--pill);
  background: var(--chip);
  overflow: hidden;
}

.meter__fill { height: 100%; background: var(--accent); }

/* Flashes ------------------------------------------------------------------- */

.flashes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 var(--shell-pad);

  &:not(:empty) { padding-top: 1rem; }
}

.flash {
  padding: 0.6rem 0.95rem;
  border-radius: var(--radius);
  font-size: 13px;
  animation: rise 160ms ease-out;
}

.flash--notice { background: var(--ok-wash); color: var(--ok); }
.flash--alert { background: var(--accent-wash); color: var(--accent); }

@keyframes rise {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.table tbody tr { animation: rise 200ms ease-out; }

@media (prefers-reduced-motion: reduce) {
  .flash, .table tbody tr, .module { animation: none; transition: none; }
}

/* Auth ---------------------------------------------------------------------- */

.auth {
  max-width: 23rem;
  margin: 4rem auto;
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.auth__form input { border-radius: var(--radius); }

.field { display: flex; flex-direction: column; gap: 0.3rem; }

.field label {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;

  & label { text-transform: none; letter-spacing: normal; font-size: 13px; color: var(--ink); }
  & input { width: auto; }
}

.field__hint { margin: 0; color: var(--ink-muted); font-size: 11px; }

.auth__links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.25rem;
  font-size: 12.5px;
}

.errors {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 12.5px;
}

.errors__title { margin: 0; font-size: 12.5px; }
.errors__list { margin: 0.3rem 0 0; padding-left: 1.1rem; }

/* Empty state --------------------------------------------------------------- */

.empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}

/* Employee Drive ------------------------------------------------------------ */

.drive {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

@media (width >= 62rem) {
  .drive { grid-template-columns: 15rem minmax(0, 1fr); }
}

.drive__rail {
  position: sticky;
  top: 5rem;
}

.drive__main { min-width: 0; }

.drive__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.rail__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  color: var(--ink-mid);
  font-size: 13px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  &:hover { background: var(--chip); color: var(--ink); }

  & svg { flex: 0 0 auto; opacity: 0.55; }
}

.rail__link--on {
  background: var(--accent-wash);
  color: var(--accent);
  font-weight: 600;

  & svg { opacity: 1; }
}

.rail__nest {
  margin-left: 0.7rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--line);
}

/* File type tag in a row */
.filetype {
  display: grid;
  place-items: center;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  border-radius: 7px;
  background: var(--ink-strong);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.filetype--folder { background: var(--accent); }

.row--folder .identity__name { font-weight: 650; }

/* An input paired with a submit, sitting on one line */
.inline-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.inline-form input[type="text"] { border-radius: var(--pill); }

/* A file input that is triggered by its wrapping label, not shown itself. Not
   display:none — that removes it from the form and from keyboard focus. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

label.btn { position: relative; cursor: pointer; }

label.btn:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* Share link box ------------------------------------------------------------ */

.linkbox {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.4rem 0 0.2rem;
  max-width: 100%;
}

.linkbox input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.3rem 0.6rem;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-mid);
  background: var(--surface-sunk);
}

.feed__item .btn { flex: 0 0 auto; align-self: flex-start; }
.feed__item form { margin: 0; }

/* Employee Chat ------------------------------------------------------------- */

.chat {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  height: calc(100vh - 9rem);
  min-height: 30rem;
}

@media (width >= 62rem) {
  .chat { grid-template-columns: 18rem minmax(0, 1fr); }
  .chat:has(.chat__members) { grid-template-columns: 18rem minmax(0, 1fr) 15rem; }
}

.chat__list,
.chat__thread,
.chat__members,
.chat__empty {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.chat__members { padding: 1rem; overflow-y: auto; }
.chat__empty { align-items: center; justify-content: center; }

.chat__list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.chat__list-head .inline-form input { font-size: 12px; padding: .3rem .6rem; }
.chat__list-head .btn { padding: .3rem .6rem; }

.chat__filters {
  display: flex;
  gap: .35rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--line);
}

.chat__filters .chip { text-decoration: none; }

.chat__threads { flex: 1; overflow-y: auto; }

.thread {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;

  &:hover { background: var(--surface-sunk); }
}

.thread--on { background: var(--accent-wash); }

.thread__body { flex: 1; min-width: 0; }

.thread__top {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: baseline;
}

.thread__name {
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread__time { color: var(--ink-muted); font-size: 10px; flex: 0 0 auto; }

.thread__preview {
  display: block;
  color: var(--ink-muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread__badge {
  flex: 0 0 auto;
  min-width: 18px;
  padding: 0 5px;
  border-radius: var(--pill);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.chat__head {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .85rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.chat__title { font-weight: 700; letter-spacing: -0.01em; }

.chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.chat__messages > #messages {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.msg { display: flex; gap: .65rem; align-items: flex-start; }

.msg__body { min-width: 0; }

.msg__meta { display: flex; gap: .5rem; align-items: baseline; }
.msg__who { font-size: 12px; font-weight: 650; }
.msg__time { color: var(--ink-muted); font-size: 10px; }

.msg__text {
  display: inline-block;
  margin-top: .2rem;
  padding: .5rem .8rem;
  border-radius: 12px;
  background: var(--chip);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* "Mine" can't be a class on the partial: a broadcast has no current_user to branch on.
   Instead every message carries its sender id, and the chat page emits one per-viewer
   rule matching that id — see the <style> block in conversations/index. */
.msg--mine { flex-direction: row-reverse; }
.msg--mine .msg__meta { flex-direction: row-reverse; }
.msg--mine .msg__body { text-align: right; }
.msg--mine .msg__text { background: var(--ink-strong); color: #fff; text-align: left; }

.chat__composer {
  padding: .85rem 1.15rem;
  border-top: 1px solid var(--line);
}

.chat__composer form { display: flex; gap: .5rem; align-items: center; }
.chat__composer input[type="text"] { flex: 1; }

.member {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}

.member__body { flex: 1; min-width: 0; font-size: 12.5px; }
.member__name { font-weight: 600; }

.member__actions {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  align-items: flex-end;
}

.member__actions form { margin: 0; }
.member__actions .btn { padding: .2rem .5rem; font-size: 10.5px; }

/* Chat attachments and voice notes ------------------------------------------ */

.chat__composer form { flex-wrap: wrap; }

.attach {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-top: .3rem;
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  max-width: 18rem;

  &:hover { border-color: var(--ink-muted); }
}

.attach__body { min-width: 0; }

.attach__name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg__image {
  display: block;
  margin-top: .3rem;
  max-width: 15rem;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
}

.msg__image img { width: 100%; height: auto; }

.voice {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: .3rem;
}

.voice audio { height: 34px; max-width: 15rem; }
.voice__time { color: var(--ink-muted); font-size: 11px; }

/* [hidden] only wins if nothing sets display afterwards — an explicit display on the
   element itself beats the UA's [hidden] rule, which left the recording bar on screen. */
.recording[hidden] { display: none; }

.recording {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .2rem .5rem;
  border-radius: var(--pill);
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.recording__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: .25; } }

@media (prefers-reduced-motion: reduce) {
  .recording__dot { animation: none; }
}

/* A label wrapping a hidden input still needs to look like a button. */
label.icon-btn { cursor: pointer; }
label.icon-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Start a direct chat ------------------------------------------------------- */

.chat__new {
  border-bottom: 1px solid var(--line);
}

.chat__new > summary {
  padding: .6rem 1rem;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;

  &:hover { color: var(--ink); }
}

.chat__new form { padding: 0 1rem .6rem; }
.chat__new input[type="search"] { font-size: 12px; padding: .35rem .7rem; }

.chat__people {
  max-height: 13rem;
  overflow-y: auto;
}

/* button_to renders a form; the row has to look and behave like a list item. */
.person-row__form { margin: 0; }

.person-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .5rem 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;

  &:hover { background: var(--surface-sunk); }
}

.person-row__body { min-width: 0; flex: 1; }

.person-row__name {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Calls --------------------------------------------------------------------- */

.call {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  height: calc(100vh - 9rem);
  min-height: 28rem;
}

.call__head {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .75rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.call__title { font-weight: 700; letter-spacing: -0.01em; }

.call__stage {
  flex: 1;
  display: grid;
  gap: .6rem;
  /* Tiles size themselves: one big, many small, no breakpoint juggling. */
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  align-content: start;
  padding: .6rem;
  border-radius: var(--radius-lg);
  background: var(--ink-strong);
  overflow-y: auto;
}

.tile {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: #000;
  overflow: hidden;
  outline: 2px solid transparent;
  transition: outline-color 120ms ease;
}

.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Your own tile is mirrored, the way every video app does it. */
.tile--me video { transform: scaleX(-1); }

.tile--speaking { outline-color: var(--accent); }

.tile__name {
  position: absolute;
  left: .5rem;
  bottom: .5rem;
  padding: .15rem .5rem;
  border-radius: var(--pill);
  background: rgb(0 0 0 / 55%);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.call__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.call__bar form { margin: 0; }

.call__btn {
  width: 42px;
  height: 42px;
}

.call__btn--off {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* "A call is happening" banner in the thread */
.call-banner {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0 1.15rem .6rem;
  padding: .6rem .9rem;
  border-radius: var(--radius);
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}

.call-banner form { margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
}

/* Meetings ------------------------------------------------------------------ */

.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cal__dayname {
  padding: .5rem;
  background: var(--surface-sunk);
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
}

.cal__cell {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-height: 6.5rem;
  padding: .35rem;
  background: var(--surface);
}

.cal__cell--muted { background: var(--surface-sunk); }
.cal__cell--muted .cal__date { opacity: .4; }

.cal__cell--today .cal__date {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
}

.cal__date {
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  font-size: 11px;
  font-weight: 700;
}

.cal__event {
  display: block;
  padding: .15rem .35rem;
  border-radius: 5px;
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  &:hover { filter: brightness(0.96); }
}

.cal__event--off {
  background: var(--chip);
  color: var(--ink-muted);
  text-decoration: line-through;
}

.cal__time { font-variant-numeric: tabular-nums; opacity: .75; margin-right: .2rem; }
.cal__more { color: var(--ink-muted); font-size: 10px; padding-left: .35rem; }

/* Meeting alerts ------------------------------------------------------------ */

.toasts {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  max-width: 22rem;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 6px 24px rgb(16 18 29 / 14%);
  animation: rise 180ms ease-out;
}

.toast__icon { color: var(--accent); flex: 0 0 auto; margin-top: .1rem; }
.toast__body { flex: 1; min-width: 0; font-size: 13px; }

.toast__actions {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 0 0 auto;
}

.toast__actions form { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

/* Meeting responses --------------------------------------------------------- */

.rsvp {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.rsvp__form { margin: 0; }

.rsvp__summary {
  color: var(--ink-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

/* Waiting room and knocks --------------------------------------------------- */

.waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-top: 1.75rem;
}

.waiting__pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

.knocks {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: .6rem;
}

.knock {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-wash);
  font-size: 13px;
}

.knock__body { flex: 1; min-width: 0; }

.knock__actions {
  display: flex;
  gap: .35rem;
  flex: 0 0 auto;
}

.knock__actions form { margin: 0; }

.call__invite {
  display: flex;
  gap: .35rem;
  align-items: center;
  margin-right: auto;
}

.call__bar { flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  .waiting__pulse { animation: none; }
}
