:root {
  --bg: #ffffff;
  --text: #111111;
  --text-2: #3a3a3a;
  --muted: #8d8d8d;
  --line: #ececec;
  --soft: #f4f4f4;
  --blue: #3d6df2;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.app {
  display: grid;
  grid-template-columns: 227px 330px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  border-right: 1px solid var(--line);
  padding: 20px 15px;
}

.account {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 0 6px 0 7px;
  height: 26px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 9.5px;
  font-weight: 500;
  color: #666;
  letter-spacing: .02em;
}

.account-name { font-size: 15px; font-weight: 600; flex: 1; text-align: left; }
.chev { width: 14px; height: 14px; color: #888; }

.nav { margin-top: 39px; display: grid; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  color: #6f6f6f;
  font-size: 14px;
  transition: background .15s;
}
.nav-item:hover { background: #fafafa; }
.nav-item.is-active { background: var(--soft); color: var(--text); }
.nav-item span:first-of-type { flex: 1; }
.nav-item .count { flex: none; font-size: 13px; color: #666; padding-right: 4px; }

/* ---------- List ---------- */
.list {
  border-right: 1px solid var(--line);
  padding: 20px 12px;
  overflow: auto;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 7px;
  height: 26px;
}
.list-head h1 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }

.filter { display: flex; gap: 9px; }
.filter button { font-size: 14px; color: var(--muted); }
.filter .is-active { color: var(--text); font-weight: 500; }

.threads { margin-top: 11px; }

.thread {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 11px 9px 11px 9px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.thread + .thread::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  border-top: 1px solid #f2f2f2;
}
.thread.is-active, .thread:hover { background: var(--soft); }
.thread.is-active::before, .thread.is-active + .thread::before,
.thread:hover::before, .thread:hover + .thread::before { opacity: 0; }

.logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line);
  flex: none;
  color: #222;
}
.logo .apple { width: 16px; height: 16px; fill: #000; }
.logo .icon { width: 16px; height: 16px; stroke-width: 1.6; }
.logo-text { font-size: 11px; color: #777; letter-spacing: .02em; }
.vitra { font-size: 10.5px; font-weight: 600; color: #111; letter-spacing: -.02em; }
.norm b { font-size: 5.5px; font-weight: 700; color: #111; border: 1px solid #111; padding: 1px 2px; letter-spacing: .05em; }

.thread-body { flex: 1; min-width: 0; }
.thread .row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.thread strong { font-size: 14px; font-weight: 600; }
.thread time { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.thread p { font-size: 13.5px; color: #777; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); display: inline-block; }

/* ---------- Reader ---------- */
.reader {
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.reader-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 0 20px 0 26px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  margin: 0 -10px;
}
.tools { display: flex; align-items: center; gap: 4px; }
.tool {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 7px;
  color: #7a7a7a;
  transition: background .15s, color .15s;
}
.tool:hover { background: var(--soft); color: var(--text); }
.tool .icon { width: 15px; height: 15px; }
.tool-gap { width: 22px; }

.message {
  max-width: 570.4px;
  margin: 0 auto;
  padding: 20px 0 120px;
}

.message-head { display: flex; align-items: center; gap: 13px; }
.logo-lg { width: 40px; height: 40px; border-radius: 10px; }
.logo-lg .apple { width: 18px; height: 18px; }
.sender { flex: 1; display: grid; line-height: 1.35; }
.sender strong { font-size: 14.5px; font-weight: 600; }
.sender span { font-size: 13px; color: var(--muted); }
.message-head time { align-self: flex-start; margin-top: 1px; font-size: 13px; color: var(--muted); }

.message-body { margin-top: 32px; font-size: 14px; line-height: 22px; letter-spacing: -0.005em; color: var(--text); }
.message-body p + p { margin-top: 19px; }

/* ---------- Reply slot ---------- */
.reply-slot { position: relative; margin-top: 30px; }

.composer {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
  transition: opacity .2s ease, transform .2s ease;
}
.composer.is-hidden { visibility: hidden; opacity: 0; transition: none; }
.composer.is-entering { animation: composerIn .28s cubic-bezier(.2, .7, .2, 1); }

@keyframes composerIn {
  from { opacity: 0; transform: translateY(4px) scale(.995); }
  to   { opacity: 1; transform: none; }
}

.composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 18px 0 19px;
  border-bottom: 1px solid #f1f1f1;
}
.composer-title { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.composer-title .icon { width: 14px; height: 14px; color: #8a8a8a; }

.send {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 0;
  border-radius: 6px;
  transition: opacity .12s, transform .12s;
}
.send:hover { opacity: .65; }
.send.is-pressed, .send:active { opacity: .5; transform: scale(.97); }
.send-icon { width: 12.5px; height: 12.5px; stroke-width: 2.1; }

.field {
  display: flex;
  align-items: center;
  height: 37px;
  padding: 0 19px 0 20px;
  border-bottom: 1px solid #f1f1f1;
  font-size: 12px;
}
.field .label { width: 59px; color: #9a9a9a; }
.field .value { font-weight: 500; color: var(--text); }

.composer-body {
  padding: 16px 19px 21px 19px;
  font-size: 12.85px;
  line-height: 21px;
  color: var(--text);
  outline: none;
  min-height: 120px;
  max-height: 420px;
  overflow: auto;
}
.composer-body p + p { margin-top: 14px; }

.sent-pill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 19px;
  border: 1px solid #ececec;
  border-radius: var(--radius);
  background: #f8f8f8;
  font-size: 13px;
  color: var(--text-2);
}
.sent-pill[hidden] { display: none; }
.sent-pill .icon { width: 12.5px; height: 12.5px; color: #666; stroke-width: 2.1; }
.sent-pill span { flex: 1; }
.sent-pill .view { color: #9a9a9a; font-size: 13px; transition: color .15s; }
.sent-pill .view:hover { color: var(--text); }
.sent-pill.is-entering { animation: pillIn .32s cubic-bezier(.2, .7, .2, 1); }

@keyframes pillIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- FX layer ---------- */
.fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.demo-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 17px;
  height: 21px;
  z-index: 50;
  pointer-events: none;
  transform-origin: 3px 2px;
  will-change: transform;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .25));
  transition: opacity .25s;
}
.demo-cursor.is-gone { opacity: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .app { grid-template-columns: 0 300px minmax(0, 1fr); }
  .sidebar { display: none; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .list { display: none; }
  .reader-scroll { padding: 0 16px; }
}
