:root {
  --ink: #123d4e;
  --secondary: #456372;
  --muted: #526f7d;
  --accent: #b84e00;
  --orange: #f47b16;
  --soft: #fff2e7;
  --context: #f2f7f7;
  --line: #d6e1e5;
  --control: #718a96;
  --focus: #246b8a;
  --danger: #b42318;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: white;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
a {
  color: var(--focus);
}
button {
  border: 0;
  background: transparent;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button,
.button {
  min-height: 44px;
}
input,
textarea {
  border: 1px solid var(--control);
  border-radius: 6px;
  background: #fff;
  font-size: 16px;
}
input {
  height: 50px;
  padding: 0 14px;
  width: 100%;
}
textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin: 0 0 8px;
}
small,
.muted {
  color: var(--muted);
}
.mono,
.eyebrow {
  font:
    600 11px/1.5 "SFMono-Regular",
    Consolas,
    monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.eyebrow {
  color: var(--accent);
  margin-bottom: 16px;
}
.primary {
  background: var(--accent);
  color: white;
  border-radius: 6px;
  padding: 12px 20px;
  font-weight: 650;
}
.primary:hover {
  background: #9c4200;
}
.secondary {
  border: 1px solid var(--control);
  border-radius: 6px;
  padding: 8px 16px;
}
.secondary:hover,
.icon-button:hover {
  background: var(--context);
}
.link-button {
  color: var(--focus);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 6px;
}
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 20px;
  letter-spacing: -0.7px;
}
.brand img {
  width: 32px;
  height: 32px;
}
.brand span span {
  font-weight: 400;
  color: var(--muted);
}
.skip {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 99;
  background: white;
  padding: 12px;
}
.skip:focus {
  top: 10px;
}
.loading {
  padding: 48px;
}
.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 58% 42%;
}
.auth-context {
  padding: 48px 64px;
  background-color: var(--context);
  background-image:
    linear-gradient(rgba(18, 61, 78, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 61, 78, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
}
.auth-hero {
  padding: 80px 0;
  max-width: 620px;
}
.auth-hero h1 {
  font-size: clamp(40px, 4.8vw, 76px);
  font-weight: 750;
  letter-spacing: -3px;
  line-height: 1.08;
  margin-bottom: 24px;
}
.auth-hero h1 em {
  color: var(--accent);
  font-style: normal;
}
.auth-hero p {
  max-width: 420px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--secondary);
}
.features {
  display: flex;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.features span {
  font-size: 12px;
  color: var(--secondary);
}
.features b {
  color: var(--accent);
  margin-right: 8px;
}
.auth-task {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.auth-form {
  width: 100%;
  max-width: 380px;
}
.auth-form h2 {
  font-size: 30px;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.auth-form > p {
  color: var(--secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}
.field {
  margin-bottom: 20px;
}
.auth-form .primary {
  width: 100%;
  margin-top: 4px;
}
.fine {
  font-size: 13px !important;
  line-height: 1.6;
  margin-top: 24px !important;
}
.error {
  color: var(--danger);
  font-size: 14px;
  line-height: 1.5;
  margin: 12px 0;
  min-height: 0;
}
.shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: 244px 1fr;
  overflow: hidden;
}
.sidebar {
  background: var(--context);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 28px 16px 16px;
  min-height: 0;
}
.sidebar .brand {
  padding: 0 12px 30px;
}
.sidebar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  color: var(--muted);
}
.people {
  overflow: auto;
  flex: 1;
  padding: 8px 0;
}
.person {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.person:hover {
  background: #e7eeee;
}
.person.active {
  background: white;
  border: 1px solid var(--line);
  padding: 11px;
}
.person.active .person-name {
  font-weight: 700;
}
.person.active:before {
  content: "";
  height: 24px;
  width: 3px;
  background: var(--orange);
  position: absolute;
  margin-left: -12px;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e3ecee;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}
.avatar.mine {
  background: var(--soft);
  color: var(--accent);
}
.person-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.person-name {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person-info small {
  font-size: 12px;
}
.sidebar-footer {
  border-top: 1px solid var(--line);
  padding: 16px 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer .person-info {
  flex: 1;
}
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.workspace-header {
  min-height: 97px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  gap: 16px;
}
.workspace-header h1 {
  font-size: 24px;
  letter-spacing: -0.7px;
}
.workspace-header p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.header-name {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.status:before {
  content: "";
  height: 6px;
  width: 6px;
  border-radius: 100%;
  background: #246b45;
}
.status.offline:before {
  background: #b42318;
}
.header-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
.content {
  display: flex;
  flex: 1;
  min-height: 0;
}
.conversation {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.toolbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  gap: 16px;
  border-bottom: 1px solid #edf1f3;
}
.tabs {
  display: flex;
  align-self: stretch;
  gap: 24px;
}
.tab {
  font-size: 13px;
  color: var(--muted);
  padding: 0;
  position: relative;
}
.tab.active {
  color: var(--ink);
  font-weight: 650;
}
.tab.active:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--orange);
}
.search {
  height: 36px;
  max-width: 210px;
  font-size: 13px;
  padding: 0 12px;
}
.search-label {
  margin: 0;
}
.feed {
  overflow: auto;
  flex: 1;
  padding: 24px 40px;
  scroll-behavior: smooth;
}
.feed-inner {
  max-width: 820px;
  margin: 0 auto;
}
.date-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 28px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.date-divider:before,
.date-divider:after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.message {
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}
.message.done {
  background: #fafcfc;
}
.message-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 0;
}
.message-top .avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 10px;
}
.message-top strong {
  font-size: 13px;
}
.message-top time {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}
.message-body {
  padding: 12px 20px 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
  font-size: 15px;
}
.message-attachments {
  padding: 0 20px 16px;
  display: grid;
  gap: 8px;
}
.screenshot-link {
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--context);
  max-width: 600px;
}
.screenshot-link img {
  display: block;
  max-width: 100%;
  max-height: 330px;
  object-fit: contain;
  margin: auto;
}
.file-link {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.message-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 0 12px;
}
.reply-button {
  color: var(--focus);
  font-size: 12px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.done-button {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
}
.done-button.is-done {
  color: #246b45;
}
.done-button .icon {
  width: 16px;
}
.empty {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  max-width: 440px;
  margin: auto;
  padding: 40px 16px;
}
.empty-mark {
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  background: var(--context);
}
.empty-mark .icon {
  width: 26px;
  height: 26px;
}
.empty .eyebrow {
  margin-bottom: 12px;
}
.empty h2 {
  font-size: 26px;
  letter-spacing: -0.8px;
  line-height: 1.25;
  margin-bottom: 12px;
}
.empty p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--secondary);
}
.empty .primary {
  margin-top: 24px;
}
.composer-wrap {
  border-top: 1px solid var(--line);
  padding: 20px 40px 16px;
}
.composer {
  max-width: 820px;
  margin: auto;
}
.compose-box {
  border: 1px solid var(--control);
  border-radius: 8px;
  background: white;
}
.compose-box:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 1px var(--focus);
}
.compose-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.compose-box textarea {
  width: 100%;
  border: 0;
  border-radius: 8px;
  resize: none;
  min-height: 68px;
  padding: 16px;
  background: transparent;
  outline: none;
  font-size: 14px;
}
.compose-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 8px;
  gap: 8px;
}
.attach {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--secondary);
  padding: 0 8px;
}
.send {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.send .icon {
  height: 16px;
  width: 16px;
}
.composer-note {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  gap: 16px;
}
.pending-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px;
}
.pending-file {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: var(--context);
  padding: 4px 8px;
  border-radius: 4px;
  max-width: 100%;
}
.pending-file img {
  width: 40px;
  height: 32px;
  object-fit: cover;
}
.pending-file span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pending-file button {
  min-height: 32px;
  min-width: 32px;
}
.thread {
  width: 400px;
  max-width: 45%;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: #fbfcfc;
  min-width: 300px;
}
.thread-header {
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  min-height: 64px;
}
.thread-header h2 {
  font-size: 16px;
}
.thread-feed {
  padding: 24px 20px;
  overflow: auto;
  flex: 1;
}
.thread .message {
  margin-bottom: 16px;
}
.thread .message-top {
  padding: 12px 12px 0;
  gap: 6px;
}
.thread .message-body {
  padding: 12px;
  font-size: 14px;
}
.thread .message-attachments {
  padding: 0 12px 12px;
}
.thread .message-top strong {
  font-size: 12px;
}
.thread .message-top time {
  font-size: 10px;
}
.thread .composer-wrap {
  padding: 16px;
}
.thread-caption {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin: 20px 0;
}
.thread .composer-note span:last-child {
  display: none;
}
dialog {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  width: 460px;
  max-width: calc(100% - 32px);
}
dialog::backdrop {
  background: rgba(18, 61, 78, 0.3);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  font-size: 20px;
}
.dialog-body {
  padding: 24px;
}
.dialog-body > p {
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}
.dialog-body .primary {
  width: 100%;
}
.dialog-body input[readonly] {
  font-size: 13px;
  background: var(--context);
}
.invite-result {
  padding-top: 16px;
}
.invite-result p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--secondary);
  margin-bottom: 12px;
}
.invite-result .invite-email {
  color: var(--ink);
  font-weight: 600;
}
.invite-result .invite-email.error-text {
  color: var(--danger);
}
#notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  border-radius: 6px;
  padding: 12px 20px;
  max-width: calc(100% - 32px);
  font-size: 14px;
  z-index: 100;
  display: none;
}
#notice.visible {
  display: block;
}
.hidden {
  display: none !important;
}
.mobile-back {
  display: none;
}
.drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: -8px;
  background: var(--soft);
}
.join-link {
  overflow-wrap: anywhere;
}
.sidebar-empty {
  padding: 24px 12px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.connection-error {
  padding: 12px 20px;
  background: #fff2e7;
  color: #855000;
  font-size: 13px;
  line-height: 1.5;
}
@media (min-width: 1500px) {
  .sidebar {
    padding-top: 32px;
  }
  .workspace-header,
  .toolbar {
    padding-left: 56px;
    padding-right: 56px;
  }
  .feed {
    padding-left: 56px;
    padding-right: 56px;
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 208px 1fr;
  }
  .workspace-header {
    padding: 20px 24px;
  }
  .toolbar {
    padding: 0 24px;
  }
  .feed {
    padding: 24px;
  }
  .composer-wrap {
    padding: 16px 24px;
  }
  .thread {
    width: 350px;
    min-width: 290px;
  }
  .auth-context {
    padding: 40px;
  }
  .auth-task {
    padding: 32px;
  }
  .features {
    flex-direction: column;
    gap: 12px;
  }
  .auth-hero h1 {
    letter-spacing: -2px;
  }
  .header-actions .status {
    display: none;
  }
  .thread-open .search {
    max-width: 120px;
  }
}
@media (max-width: 800px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-context {
    padding: 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .auth-hero {
    padding: 40px 0 24px;
  }
  .auth-hero h1 {
    font-size: 42px;
  }
  .auth-hero p {
    font-size: 16px;
  }
  .features {
    display: none;
  }
  .auth-task {
    padding: 40px 24px;
  }
  .auth-form {
    max-width: 440px;
  }
  .shell {
    grid-template-columns: 190px 1fr;
  }
  .sidebar {
    padding: 24px 8px 12px;
  }
  .sidebar .brand {
    font-size: 18px;
  }
  .workspace-header {
    padding: 16px;
    min-height: 88px;
  }
  .workspace-header h1 {
    font-size: 20px;
  }
  .toolbar {
    padding: 0 16px;
  }
  .feed {
    padding: 20px 16px;
  }
  .composer-wrap {
    padding: 16px;
  }
  .tabs {
    gap: 16px;
  }
  .search {
    width: 140px;
  }
  .thread-open .conversation {
    display: none;
  }
  .thread {
    max-width: none;
    width: 100%;
    border-left: 0;
    min-width: 0;
  }
  .message-top {
    padding: 12px 12px 0;
  }
  .message-body {
    padding: 12px;
  }
  .message-attachments {
    padding: 0 12px 12px;
  }
  .composer-note span:last-child {
    display: none;
  }
}
@media (max-width: 580px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .shell.show-people .sidebar {
    display: flex;
    height: 100dvh;
  }
  .shell.show-people .workspace {
    display: none;
  }
  .shell.show-people {
    grid-template-columns: 1fr;
  }
  .mobile-back {
    display: inline-flex;
  }
  .workspace-header {
    min-height: 80px;
  }
  .header-name {
    gap: 4px;
  }
  .workspace-header h1 {
    font-size: 19px;
  }
  .header-actions {
    gap: 4px;
  }
  .header-actions .secondary {
    padding: 8px 10px;
    font-size: 12px;
  }
  .search {
    width: min(132px, 30vw);
    min-width: 0;
  }
  .feed {
    padding: 16px;
  }
  .auth-hero {
    padding: 32px 0 8px;
  }
  .auth-hero h1 {
    font-size: 36px;
    letter-spacing: -1.5px;
  }
  .auth-hero p {
    display: none;
  }
  .auth-task {
    padding: 32px 24px;
  }
  .auth-context .brand {
    font-size: 18px;
  }
  .person {
    padding: 16px 12px;
  }
  .sidebar .brand {
    padding-top: 16px;
  }
  .sidebar-footer {
    padding-bottom: 8px;
  }
  .composer-wrap {
    padding: 12px 16px;
  }
  .composer-note {
    font-size: 10px;
  }
  .toolbar {
    height: 58px;
  }
  .empty h2 {
    font-size: 24px;
  }
  .header-actions .help-button {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.test-toggle {
  margin: 8px 8px 16px;
  padding: 8px;
  text-align: left;
  color: var(--focus);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 6px;
}
.test-toggle:hover {
  background: #e7eeee;
}
