/* ==========================================================
   Dashboard — Email  (Figma: Slicing / node 107:346)
   ========================================================== */
:root {
  --c-text: #383838;
  --c-text-75: rgba(56, 56, 56, 0.75);
  --c-text-80: rgba(56, 56, 56, 0.8);
  --c-text-50: rgba(56, 56, 56, 0.5);
  --c-text-40: rgba(56, 56, 56, 0.4);
  --c-border: #e5e7eb;
  --c-border-soft: #e7e7e7;
  --c-surface: #ffffff;
  --c-surface-muted: #fbfaf8;
  --c-page: #fafafa;
  --c-dark: #222222;
  --c-active-nav: #e5f6f7;
  --c-avatar-bg: #f8ecec;
  --c-pinned-bg: #fffbeb;
  --c-pinned-bar: #fe9a00;

  --hairline: 0.8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* Hide the frame until the GSAP intro has set its start states (no flash). */
html.intro .app { visibility: hidden; }

body {
  background: var(--c-page);
  color: var(--c-text);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 32; /* Inter Display */
  -webkit-font-smoothing: antialiased;
}
p, h1, h2, ul { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }

/* ---------- App frame ---------- */
.app {
  display: flex;
  gap: 8px;
  align-items: stretch;
  height: 100vh;
  height: 100dvh;
  min-width: 1280px;
  overflow: hidden; /* page never scrolls; each panel scrolls on its own */
}

/* ---------- Shared bits ---------- */
.avatar {
  display: block;
  position: relative;
  flex-shrink: 0;
  border-radius: 100px;
  background: var(--c-surface);
}
.avatar > img:not(.avatar__dot) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 100px;
}
.avatar--pink { background: var(--c-avatar-bg); }
.avatar--28 { width: 28px; height: 28px; }
.avatar--36 { width: 36px; height: 36px; }
.avatar--40 { width: 40px; height: 40px; }
.avatar__dot { position: absolute; width: 8px; height: 8px; }
.avatar--36 .avatar__dot { left: 26px; top: 28px; }
.avatar--36 .avatar__dot--bottom { top: auto; bottom: 0; }
.avatar--40 .avatar__dot { left: 29px; top: 32px; }
.avatar--ring { border: 1.2px solid #fff; }
.avatar--ring > img:not(.avatar__dot) { inset: 0; }

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--c-surface);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.icon-btn--raised {
  border: 0.6px solid var(--c-border-soft);
  background: linear-gradient(180deg, #fff 0%, #f7f7f7 100%);
  box-shadow: 0 0.6px 2.2px rgba(0, 0, 0, 0.09);
}
.icon-btn.is-active { background: var(--c-active-nav); }
.icon-btn:not(.is-active):not(.icon-btn--raised):hover { background: #f5f5f5; }

.btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-dark);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 500;
}

.ghost-icon {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
}
.composer__tools .ghost-icon { width: 12px; height: 12px; }

/* ==========================================================
   Left: rail + inbox
   ========================================================== */
.left { display: flex; flex-shrink: 0; height: 100%; }

.rail {
  width: 60px;
  height: 100%;
  background: var(--c-surface);
  border-right: var(--hairline) solid var(--c-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 24px 0 16px;
}
.rail__top {
  flex: 1 0 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.rail__items {
  width: 100%;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.inbox {
  width: 325px;
  height: 100%;
  background: var(--c-surface);
  border-right: var(--hairline) solid var(--c-border);
  display: flex;
  flex-direction: column;
}
.inbox__head {
  padding: 16px;
  border-bottom: var(--hairline) solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.inbox__title-row { display: flex; align-items: center; justify-content: space-between; }
.inbox__title { font-size: 22px; font-weight: 500; line-height: 1.3; letter-spacing: -0.22px; }
.inbox__tools { display: flex; gap: 8px; }

.btn-compose {
  width: 100%;
  gap: 8px;
  padding: 8px 40px;
  border-radius: 8px;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.16), 0 0 0 1px #141414;
  font-size: 14px;
  line-height: 1.4;
}
.btn-compose img { width: 18px; height: 18px; object-fit: none; }

.tabs {
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--c-border);
}
.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.28px;
  color: var(--c-text);
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
}
.tab--fill { flex: 1 0 0; min-width: 0; padding-left: 0; padding-right: 0; }
.tabs { position: relative; }
.tabs__ink {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 1px;
  height: 1px;
  background: #000;
  transform-origin: left center;
  pointer-events: none;
}
/* Fallback underline when JS/GSAP is unavailable */
html:not(.gsap-ready) .tab.is-active { border-bottom-color: #000; }

.inbox__list {
  flex: 1 0 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 20px;
  scrollbar-width: none;
}
.inbox__list::-webkit-scrollbar { display: none; }

.group-label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px 16px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.12px;
}
.group-label img { width: 12px; height: 12px; }
.group-label--spaced { padding-top: 16px; }

.thread-item {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-bottom: var(--hairline) solid var(--c-border);
  overflow: hidden;
  cursor: pointer;
}
.thread-item--last { border-bottom: 0; }
.thread-item.is-selected { background: var(--c-pinned-bg); }
.thread-item.is-selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1.8px;
  height: 100%;
  border-radius: 12px;
  background: var(--c-pinned-bar);
}
.thread-item__body { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.thread-item__top { display: flex; align-items: center; justify-content: space-between; line-height: 1; }
.thread-item__name { flex: 1 0 0; min-width: 0; font-size: 16px; font-weight: 500; letter-spacing: -0.16px; }
.thread-item__time { font-size: 12px; font-weight: 400; letter-spacing: 0.24px; opacity: 0.4; white-space: nowrap; }
.thread-item__text { display: flex; flex-direction: column; gap: 4px; }
.thread-item__subject { font-size: 14px; font-weight: 500; line-height: 1.3; }
.thread-item__preview {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-item.has-unread-dot .thread-item__time { opacity: 1; }

/* ==========================================================
   Middle: thread
   ========================================================== */
.thread-wrap {
  flex: 1 0 0;
  min-width: 0;
  padding: 12px 0;
  display: flex;
}
.thread {
  flex: 1 0 0;
  min-width: 0;
  background: var(--c-surface);
  border: var(--hairline) solid var(--c-border);
  border-radius: 12px;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.thread__scroll {
  flex: 1 0 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}
.thread__head { padding: 0 32px; display: flex; flex-direction: column; gap: 8px; }
.thread__title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.thread__title { font-size: 18px; font-weight: 500; line-height: 1.4; letter-spacing: -0.18px; white-space: nowrap; }
.thread__actions { display: flex; align-items: center; gap: 16px; }

.participants { display: flex; align-items: center; gap: 12px; }
.participants__stack { display: flex; align-items: center; }
.participants__stack .avatar { margin-right: -6px; }
.participants__stack .avatar:last-child { margin-right: 0; }
.participants__count { font-size: 14px; font-weight: 500; line-height: 1; letter-spacing: 0.28px; opacity: 0.4; white-space: nowrap; }

.messages { margin-top: 40px; }
.message { padding: 0 32px; display: flex; flex-direction: column; gap: 24px; }
.message--reply {
  margin-top: 24px;
  padding-top: 24px;
  border-top: var(--hairline) solid var(--c-border);
}

.sender { display: flex; align-items: center; gap: 12px; }
.sender__info { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.sender__name-row { display: flex; align-items: center; gap: 6px; }
.sender__name { font-size: 16px; font-weight: 500; line-height: 1; letter-spacing: -0.16px; white-space: nowrap; }
.verified { width: 16px; height: 16px; display: grid; place-items: center; }
.sender__email { font-size: 14px; font-weight: 500; line-height: 1; letter-spacing: 0.14px; opacity: 0.4; white-space: nowrap; }

.message__body {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--c-text-75);
  overflow-wrap: anywhere;
}
.message--mine .message__body { white-space: pre-wrap; }
.message__body ul { padding-left: 21px; }
.message__body--reply { max-width: 561px; }

.attachments { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.attachments__label { font-size: 12px; font-weight: 400; line-height: 1; letter-spacing: 0.12px; opacity: 0.4; }
.file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--c-surface-muted);
  border: var(--hairline) solid var(--c-border);
  border-radius: 12px;
}
.file__icon { width: 24px; height: 32px; object-fit: cover; }
.file__meta { display: flex; flex-direction: column; gap: 8px; font-weight: 500; line-height: 1; white-space: nowrap; }
.file__name { font-size: 12px; letter-spacing: 0.12px; }
.file__size { font-size: 10px; letter-spacing: 0.1px; color: var(--c-text-50); }

/* Composer */
.composer-wrap { padding: 24px 32px 0; flex-shrink: 0; }
.composer {
  min-height: 101px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  background: var(--c-surface-muted);
  border: var(--hairline) solid var(--c-border);
  border-radius: 8px;
  filter: drop-shadow(0 2.2px 3.1px rgba(0, 0, 0, 0.04));
  transition: border-color 120ms ease;
}
.composer:focus-within { border-color: #cfd2d8; }
.composer__input {
  width: 100%;
  resize: none;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--c-text);
  height: 22.4px;
  max-height: 180px;
  overflow-y: auto;
}
.composer__input::placeholder { color: var(--c-text); opacity: 0.35; }
.composer__bar { display: flex; align-items: center; justify-content: space-between; }
.composer__tools { display: flex; align-items: flex-start; gap: 14px; }
.btn-send {
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
  font-size: 12px;
  line-height: 1.3;
}

/* ==========================================================
   Right: insights
   ========================================================== */
.insights {
  width: 360px;
  flex-shrink: 0;
  height: 100%;
  background: var(--c-surface);
  border: var(--hairline) solid var(--c-border);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-wrap { padding: 0 16px; display: flex; flex-direction: column; flex-shrink: 0; }
/* Grows to fill the panel, but never shrinks below its content — the panel scrolls instead. */
.card-wrap--fill { flex: 1 0 auto; }
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 6px 6px;
  background: var(--c-surface-muted);
  border: var(--hairline) solid var(--c-border);
  border-radius: 12px;
  filter: drop-shadow(0 1.2px 2.6px rgba(0, 0, 0, 0.04));
}
.card--fill { flex: 1 0 auto; }
.card__head { display: flex; align-items: center; gap: 8px; padding: 0 10px; font-size: 14px; font-weight: 500; line-height: 1.4; }
.card__head > img { width: 14px; height: 14px; }
.card__head--between { justify-content: space-between; }
.card__head-l { display: flex; align-items: center; gap: 8px; }
.ai-icon { width: 14px; height: 14px; display: grid; place-items: center; }
.card__updated { font-size: 11px; font-weight: 400; line-height: 1.4; color: var(--c-text-40); white-space: nowrap; }

.card__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--c-surface);
  border-radius: 10px;
  filter: drop-shadow(0 0.4px 1.1px rgba(0, 0, 0, 0.08));
}
.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.12px;
  white-space: nowrap;
}
.kv--line { padding-bottom: 8px; border-bottom: var(--hairline) solid var(--c-border); }
.kv__k { font-weight: 400; color: var(--c-text-40); }
.kv__k--medium { font-weight: 500; }
.kv__v { font-weight: 500; color: var(--c-text); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 3px;
  border: var(--hairline) solid;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.12px;
  white-space: nowrap;
}
.pill--green { background: #f0fdf4; border-color: #dff5e6; color: #00bc7d; }
.pill--orange { background: #fff2e2; border-color: #f9e5cc; color: #ff6900; }
.pill--red { background: #fef2f2; border-color: #ffe2e2; color: #fb2c36; }
.pill--neutral { background: var(--c-surface-muted); border-color: var(--c-border); color: var(--c-text-80); }

.card--ai {
  border-color: rgba(229, 231, 235, 0.5);
  background: linear-gradient(118.52deg, #ffedfd 6.14%, #fffcf4 27.67%, #eafaff 66.32%, #eaf8ff 98.46%);
  filter: none;
  box-shadow: 0 1.2px 22px rgba(102, 107, 255, 0.06), 0 1.2px 6.2px rgba(255, 16, 207, 0.03);
}
.card__inner--ai {
  background: rgba(255, 255, 255, 0.24);
  filter: none;
  box-shadow: 0 2.2px 12px rgba(153, 162, 255, 0.25), 0 0.4px 2.2px rgba(0, 0, 0, 0.08);
}
.card__inner--ai p { font-size: 12px; font-weight: 400; line-height: 1.52; letter-spacing: 0.12px; color: var(--c-text-80); }

.actions { flex: 1 0 auto; display: flex; flex-direction: column; gap: 6px; }
.action {
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--c-surface);
  border-radius: 10px;
  filter: drop-shadow(0 0.4px 1.1px rgba(0, 0, 0, 0.08));
}
.action__inner { display: flex; flex-direction: column; gap: 10px; }
.actions--fill .action { flex: 1 0 auto; }
.actions--fill .action:last-child .action__inner { flex: 1 0 0; justify-content: space-between; gap: 0; }
.action__title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: 0.12px; cursor: pointer; }
.action__title > span:last-child { flex: 1 0 0; min-width: 0; }
.action__title--ellipsis > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.action__tags { display: flex; align-items: center; gap: 4px; padding: 0 20px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--c-surface-muted);
  border: var(--hairline) solid var(--c-border);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.1px;
  color: var(--c-text-80);
  white-space: nowrap;
}
.tag img { width: 10px; height: 10px; }
.tag--high { background: #fef2f2; border-color: #ffe2e2; color: #fb2c36; }
.tag--medium { background: #fff2e2; border-color: #f9e5cc; color: #ff6900; }
.tag--low { background: #fffbeb; border-color: #fef9c2; color: #f0b100; }
.action__btn { padding-left: 20px; }
.btn-light {
  width: 100%;
  padding: 5px 20px;
  border-radius: 5px;
  border: 0.6px solid var(--c-border);
  background: linear-gradient(180deg, #fff 0%, #f7f7f7 100%);
  box-shadow: 0 0.6px 1.2px rgba(0, 0, 0, 0.05);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.1px;
  color: var(--c-text-50);
}
.btn-light:hover { color: var(--c-text-80); }

/* ---------- Demo state switcher (not part of design) ---------- */
.demo {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  width: max-content;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(34, 34, 34, 0.92);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  z-index: 50;
}
.demo[hidden] { display: none; }
.demo__label { padding: 0 8px 0 10px; opacity: 0.5; }
.demo button { padding: 6px 10px; border-radius: 999px; color: rgba(255, 255, 255, 0.75); }
.demo button:hover { color: #fff; }
.demo button.is-on { background: #fff; color: var(--c-dark); }

/* Action item done state */
.action.is-checked .action__title > span:last-child { color: var(--c-text-40); text-decoration: line-through; text-decoration-color: rgba(56, 56, 56, 0.4); }
.btn-light.is-added { color: #00bc7d; }

/* Thread list hover handled by GSAP; keep a CSS fallback */
html:not(.gsap-ready) .thread-item:not(.is-selected):hover { background: #fafafa; }

/* Unread badge on the "All" tab (matches assets/icons/badge-2.svg) */
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: #ec003f;
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.badge[hidden] { display: none; }

/* Unread thread in the list */
.thread-item__meta { display: flex; align-items: center; gap: 6px; }
.unread-dot { width: 6px; height: 6px; border-radius: 50%; background: #ec003f; flex-shrink: 0; }
.thread-item.is-unread .thread-item__time { opacity: 1; font-weight: 500; }
.thread-item:focus-visible { outline: 2px solid #9ad8db; outline-offset: -2px; }

/* Right panel content wrapper (swapped per thread) */
.insights { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.insights::-webkit-scrollbar { display: none; }

/* Action item checkbox (box matches assets/icons/checkbox.svg) */
.check { position: relative; width: 14px; height: 14px; flex-shrink: 0; display: block; }
.check__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.check svg { display: block; width: 14px; height: 14px; overflow: visible; pointer-events: none; }
.check__box { fill: transparent; stroke: rgba(56, 56, 56, 0.4); stroke-width: 1; transition: stroke 120ms ease; }
.check__mark { fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.action__title:hover .check__box { stroke: rgba(56, 56, 56, 0.7); }
.check__input:focus-visible + svg .check__box { stroke: #383838; }
.check__input:focus-visible + svg { outline: 2px solid #9ad8db; outline-offset: 1px; border-radius: 3px; }
/* No-JS / reduced-motion fallback */
.is-checked .check__box { fill: #222; stroke: #222; }
.check__mark { stroke-dasharray: 10; stroke-dashoffset: 10; }
.is-checked .check__mark { stroke-dashoffset: 0; }

/* ==========================================================
   Composer tools: attach / emoji / voice
   ========================================================== */
.composer { position: relative; }

/* Bigger hit area + soft background without changing the 12px icon from the design */
.composer__tools .ghost-icon { position: relative; isolation: isolate; }
.composer__tools .ghost-icon::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 6px;
  background: transparent;
  z-index: -1;
  transition: background-color 150ms ease;
}
.composer__tools .ghost-icon:hover::before { background: rgba(56, 56, 56, 0.06); }
.composer__tools .ghost-icon.is-active::before { background: rgba(56, 56, 56, 0.1); }
.composer__tools .ghost-icon:focus-visible { outline: none; }
.composer__tools .ghost-icon:focus-visible::before { box-shadow: 0 0 0 2px #9ad8db; }

/* Pending attachments tray */
.composer__files { display: flex; flex-wrap: wrap; gap: 6px; }
.composer__files:empty { display: none; }
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 5px 6px 5px 5px;
  background: var(--c-surface);
  border: var(--hairline) solid var(--c-border);
  border-radius: 8px;
  box-shadow: 0 0.6px 1.2px rgba(0, 0, 0, 0.05);
}
.chip__thumb { width: 28px; height: 28px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.chip__pdf { width: 21px; height: 28px; object-fit: cover; flex-shrink: 0; }
.chip__audio {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-dark);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.chip__meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.chip__name { font-size: 12px; font-weight: 500; letter-spacing: 0.12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip__size { font-size: 10px; letter-spacing: 0.1px; color: var(--c-text-50); }
.chip__remove {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: var(--c-text-50);
  flex-shrink: 0;
}
.chip__remove:hover { background: rgba(56, 56, 56, 0.08); color: var(--c-text); }

.ext {
  width: 21px;
  height: 28px;
  border-radius: 4px;
  background: #eef0f3;
  border: var(--hairline) solid var(--c-border);
  display: grid;
  place-items: end center;
  padding-bottom: 4px;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--c-text-80);
  text-transform: uppercase;
  flex-shrink: 0;
}
.file .ext { width: 24px; height: 32px; font-size: 8px; }

/* Emoji picker */
.emoji-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 300px;
  padding: 8px;
  background: var(--c-surface);
  border: var(--hairline) solid var(--c-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.05);
  z-index: 20;
  transform-origin: 12px 100%;
}
.emoji-pop[hidden] { display: none; }
.emoji-pop__label { padding: 6px 6px 4px; font-size: 11px; font-weight: 500; letter-spacing: 0.11px; color: var(--c-text-40); }
.emoji-pop__grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-pop__scroll { max-height: 232px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.emoji {
  height: 32px;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.emoji:hover, .emoji:focus-visible { background: #f3f4f6; outline: none; }

/* Toast (e.g. mic permission) */
.toast {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  max-width: 320px;
  padding: 8px 12px;
  background: var(--c-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 21;
}
.toast[hidden] { display: none; }

/* Voice recorder (replaces the tools while recording) */
.recorder { display: flex; align-items: center; gap: 10px; flex: 1 0 0; min-width: 0; margin-right: 12px; }
.recorder[hidden] { display: none; }
.composer.is-recording .composer__tools { display: none; }
.recorder__dot { width: 8px; height: 8px; border-radius: 50%; background: #fb2c36; flex-shrink: 0; }
.recorder__time { font-size: 12px; font-weight: 500; letter-spacing: 0.12px; font-variant-numeric: tabular-nums; min-width: 30px; }
.recorder__bars { flex: 1 0 0; min-width: 0; height: 18px; display: flex; align-items: center; gap: 2px; overflow: hidden; }
.recorder__bars i { flex: 0 0 2px; height: 2px; border-radius: 2px; background: rgba(56, 56, 56, 0.55); }
.recorder__btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--c-text-80);
  flex-shrink: 0;
}
.recorder__btn:hover { background: rgba(56, 56, 56, 0.08); }
.recorder__btn--stop { background: #fef2f2; color: #fb2c36; }
.recorder__btn--stop:hover { background: #ffe2e2; }

/* Sent attachments inside a message */
.sent-files { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sent-images { display: flex; flex-wrap: wrap; gap: 8px; }
.sent-images img {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: var(--hairline) solid var(--c-border);
}
.sent-images img:only-child { width: auto; height: auto; max-width: 320px; max-height: 220px; }

.voice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 280px;
  padding: 8px 12px 8px 8px;
  background: var(--c-surface-muted);
  border: var(--hairline) solid var(--c-border);
  border-radius: 12px;
}
.voice__play {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c-dark);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.voice__play .i-pause { display: none; }
.voice.is-playing .i-play { display: none; }
.voice.is-playing .i-pause { display: block; }
.voice__wave { flex: 1 0 0; height: 24px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.voice__wave i { flex: 1 0 0; max-width: 3px; border-radius: 2px; background: rgba(56, 56, 56, 0.25); }
.voice__wave i.is-played { background: var(--c-dark); }
.voice__time { font-size: 11px; font-weight: 500; letter-spacing: 0.11px; color: var(--c-text-50); font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
a.file { color: inherit; text-decoration: none; }
a.file:hover { border-color: #d5d8dd; }
.composer.is-drop { border-color: #9ad8db; background: #f3fbfb; }
