/* ============================================================
   LENSO Team — app shell
   ------------------------------------------------------------
   Direction: a working tool, not a landing page. Dark rail for
   navigation so the content pane reads as paper. Mono for
   labels and metadata, system UI for anything a person reads.

   Signature: the presence strip. With four people you can show
   the whole team at once — big products can't do that, so it's
   the one thing this tool has that Slack doesn't.
   ========================================================== */

:root {
  /* rail */
  --rail:        #14171c;
  --rail-2:      #1c2027;
  --rail-3:      #262b33;
  --rail-text:   #a8b0ba;
  --rail-mute:   #6d7684;

  /* paper */
  --paper:       #ffffff;
  --paper-2:     #f5f7f4;
  --line:        #e3e7e1;
  --line-2:      #cfd5cd;

  /* ink */
  --ink:         #14171c;
  --ink-soft:    #5b636d;
  --ink-faint:   #939ba4;

  /* signal */
  --signal:      #2f6f4e;
  --signal-lift: #3d8a62;
  --signal-dim:  #e6f0ea;
  --alert:       #9c3a2a;
  --alert-dim:   #f8e9e6;
  --amber:       #b07d2b;

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ui:   system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --rail-w: 268px;
  --r:      6px;
  --r-sm:   4px;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ============================================================
   Shared
   ========================================================== */

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* Initials chip, coloured from the name so each person is
   recognisable without anyone uploading a photo. */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #fff;
  text-transform: uppercase;
  user-select: none;
}

.chip--lg { width: 38px; height: 38px; font-size: 13px; border-radius: var(--r); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--ink-faint);
}
.dot--on   { background: var(--signal-lift); }
.dot--idle { background: var(--amber); }

/* ============================================================
   App shell
   ========================================================== */

.app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  height: 100dvh;
  overflow: hidden;
}

.rail {
  display: flex;
  flex-direction: column;
  background: var(--rail);
  color: var(--rail-text);
  min-height: 0;
}

.rail__head {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--rail-3);
}

.rail__brand {
  display: block;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
}

.rail__sub {
  margin-top: 3px;
  color: var(--rail-mute);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---- presence strip: the whole team, always visible ---- */

.crew {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rail-3);
}

.crew__label { color: var(--rail-mute); margin-bottom: 10px; }

.crew__row { display: flex; gap: 7px; }

.crew__person { position: relative; cursor: default; }

.crew__person .dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--rail);
  box-sizing: content-box;
}

.crew__person--off .chip { opacity: .42; }

/* ---- channel list ---- */

.rail__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 10px;
}

.rail__section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 8px;
  color: var(--rail-mute);
}

.rail__add {
  color: var(--rail-mute);
  background: none;
  border: 0;
  font-size: 17px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
}
.rail__add:hover { color: #fff; background: var(--rail-3); }

.chan {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 1px;
  border-radius: var(--r-sm);
  color: var(--rail-text);
  font-size: 14px;
  text-decoration: none;
}

.chan:hover { background: var(--rail-2); color: #e7ebf0; }

.chan--on { background: var(--rail-3); color: #fff; font-weight: 500; }

/* green rail marks the room you're in */
.chan--on::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--signal-lift);
}

.chan__hash { font-family: var(--mono); font-size: 13px; opacity: .55; }

.chan__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chan__badge {
  margin-left: auto;
  min-width: 19px;
  padding: 1px 6px;
  border-radius: 9px;
  background: var(--signal-lift);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

.rail__empty { padding: 6px 10px; color: var(--rail-mute); font-size: 13px; }

/* ---- signed-in user, pinned bottom ---- */

.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid var(--rail-3);
  background: var(--rail-2);
}

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

.me__name {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me__role {
  color: var(--rail-mute);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me__out {
  flex: none;
  padding: 5px 9px;
  border: 1px solid var(--rail-3);
  border-radius: var(--r-sm);
  background: none;
  color: var(--rail-text);
  font-family: var(--ui);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}
.me__out:hover { background: var(--rail-3); color: #fff; }

/* ---- main pane ---- */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  height: 56px;
  flex: none;
  border-bottom: 1px solid var(--line);
}

.topbar__hash  { font-family: var(--mono); color: var(--ink-faint); }
.topbar__title { font-size: 15px; font-weight: 600; }

.topbar__meta {
  margin-left: auto;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
}

.pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 26px 22px 40px;
}

.pane__inner { max-width: 620px; }

/* ---- content ---- */

.h1   { margin: 0 0 6px; font-size: 21px; font-weight: 600; letter-spacing: -.015em; }
.lede { margin: 0 0 22px; color: var(--ink-soft); font-size: 14px; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.panel__head {
  padding: 10px 16px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
}

.row {
  display: flex;
  gap: 18px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.row:last-child { border-bottom: 0; }

.row__k {
  flex: 0 0 118px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 3px;
}

.row__v { min-width: 0; }

.inline { display: inline-flex; align-items: center; gap: 7px; }

.steps { margin: 26px 0 0; padding: 0; list-style: none; }

.steps li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-faint);
}
.steps li:last-child { border-bottom: 0; }

.steps b { font-weight: 500; color: var(--ink); }

.tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
}

.tick--done { background: var(--signal); border-color: var(--signal); color: #fff; }

/* ============================================================
   Auth — two panel
   ========================================================== */

.auth { display: grid; grid-template-columns: 1fr 1fr; height: 100dvh; }

.auth__show {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  background: var(--rail);
  color: var(--rail-text);
  overflow: hidden;
}

/* faint drafting grid drawn in CSS — no image request */
.auth__show::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right,  rgba(255,255,255,.032) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.032) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

.auth__show > * { position: relative; z-index: 1; }

.auth__brand { color: #fff; font-size: 16px; font-weight: 600; }

.auth__pitch {
  max-width: 340px;
  margin: 0;
  color: #fff;
  font-size: 27px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -.02em;
}

.auth__note { margin: 12px 0 0; max-width: 330px; font-size: 13.5px; color: #838c98; }

/* static preview of the presence strip — shows what the product
   is instead of describing it */
.preview { display: flex; gap: 8px; margin-bottom: 22px; }

.preview__p { position: relative; }

.preview__p .dot {
  position: absolute;
  right: -2px; bottom: -2px;
  width: 9px; height: 9px;
  border: 2px solid var(--rail);
  box-sizing: content-box;
}

.auth__foot {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--rail-mute);
}

.auth__form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--paper);
}

.form { width: 100%; max-width: 328px; }

.form__eyebrow { color: var(--ink-faint); margin-bottom: 14px; }
.form__title   { margin: 0 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.form__sub     { margin: 0 0 22px; color: var(--ink-soft); font-size: 14px; }

.form__foot {
  margin: 18px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 12.5px;
}

/* ---- fields ---- */

.field { margin-bottom: 14px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field input {
  width: 100%;
  padding: 11px 12px;
  font-family: var(--ui);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  transition: border-color .12s ease, box-shadow .12s ease;
}

.field input:hover { border-color: var(--ink-faint); }

.field input:focus-visible {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-dim);
}

.btn {
  width: 100%;
  margin-top: 4px;
  padding: 11px 16px;
  font-family: var(--ui);
  font-size: 14.5px;
  font-weight: 500;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background-color .12s ease;
}
.btn:hover  { background: #000; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.btn--ghost { color: var(--ink); background: var(--paper); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--paper-2); }

/* ---- notes ---- */

.note {
  margin: 0 0 15px;
  padding: 9px 12px;
  font-size: 13.5px;
  border-radius: var(--r-sm);
  border-left: 3px solid;
}
.note--alert { background: var(--alert-dim);  border-color: var(--alert);  color: var(--alert); }
.note--ok    { background: var(--signal-dim); border-color: var(--signal); color: var(--signal); }
.note--info  { background: var(--paper-2);    border-color: var(--line-2); color: var(--ink-soft); }

.pane .note { max-width: 620px; }

/* ============================================================
   Responsive
   ========================================================== */

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100dvh; }
  .auth__show {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
  }
  .auth__pitch, .auth__note, .preview { display: none; }
  .auth__form { padding: 34px 24px; align-items: flex-start; }
}

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rail { flex-direction: row; align-items: center; gap: 12px; padding: 0 14px; height: 54px; }
  .rail__head { border: 0; padding: 0; flex: none; }
  .rail__sub, .crew, .rail__scroll, .me__text { display: none; }
  .me { border: 0; background: none; padding: 0; margin-left: auto; }
  .row { flex-direction: column; gap: 2px; }
  .row__k { flex: none; }
  .pane { padding: 20px 16px 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* ============================================================
   Conversation
   ------------------------------------------------------------
   The message list scrolls; the composer stays put. That needs
   the pane to stop being the scroller, which is what
   .pane--flush does.
   ========================================================== */

.pane--flush {
  padding: 0;
  overflow: hidden;
  display: flex;
  min-height: 0;
}

.pane__flush {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.convo {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.convo__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 12px;
  overflow-wrap: anywhere;
}

.convo__empty {
  max-width: 460px;
  margin: 40px auto;
  text-align: center;
  color: var(--ink-soft);
}

/* ---- a message ---- */

.msg {
  display: flex;
  gap: 10px;
  padding: 7px 0 2px;
}

.msg__chip { flex: none; padding-top: 2px; }

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

.msg__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 1px;
}

.msg__who { font-size: 14px; font-weight: 600; }

.msg__when,
.msg__tick {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
}

.msg__body { font-size: 14.5px; line-height: 1.55; }

/* A run from the same person: no repeated name, timestamp appears
   in the left gutter on hover so the column stays quiet. */
.msg--cont {
  display: flex;
  gap: 10px;
  padding: 1px 0;
}

.msg--cont .msg__tick {
  flex: none;
  width: 30px;
  text-align: right;
  opacity: 0;
  padding-top: 3px;
  transition: opacity .1s ease;
}

.msg--cont:hover .msg__tick { opacity: 1; }

.msg--cont .msg__body { flex: 1; min-width: 0; }

.daybreak {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 8px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.daybreak::before,
.daybreak::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---- composer ---- */

.composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.composer__input {
  flex: 1;
  min-width: 0;
  resize: none;
  padding: 10px 12px;
  font-family: var(--ui);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  max-height: 160px;
  overflow-y: auto;
}

.composer__input:focus-visible {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-dim);
}

.composer__send {
  flex: none;
  padding: 10px 18px;
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.composer__send:hover  { background: #000; }
.composer__send:active { transform: translateY(1px); }
.composer__send:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

@media (max-width: 720px) {
  .convo__scroll { padding: 14px 14px 8px; }
  .composer      { padding: 10px 14px 14px; }
  .msg--cont .msg__tick { display: none; }
}
