:root {
  color-scheme: light;
  --ink: #16322e;
  --muted: #516a64;
  --teal: #00635d;
  --mint: #d9f3e8;
  --line: #d6e3db;
  --paper: #f6f9f5;
  font-family: Inter, "Avenir Next", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button { cursor: pointer; font-weight: 650; border: 1px solid transparent; color: inherit; }
button:disabled { opacity: .55; cursor: wait; }
button, input, textarea { border-radius: 10px; }
:focus-visible { outline: 3px solid #19847d; outline-offset: 3px; }
h1, h2, p { margin: 0; }
input, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #b7ccc2;
  color: var(--ink);
  padding: 12px 14px;
  background: white;
}
input::placeholder, textarea::placeholder { color: #61736d; }
label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 8px; }
.primary { background: var(--teal); color: white; padding: 12px 18px; }
.primary:hover { background: #004f4b; }
.outline, .quiet { background: white; padding: 9px 13px; }
.outline { border-color: var(--line); }
.outline:hover, .quiet:hover { background: #eef6f0; }
.bar {
  min-height: 76px;
  padding: 12px clamp(20px, 5vw, 82px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: white;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.brand, .bar nav { display: flex; align-items: center; gap: 16px; }
.brand img { object-fit: contain; }
.brand span { font-size: 14px; font-weight: 650; border-left: 1px solid var(--line); padding-left: 16px; }
.bar nav button { font-size: 14px; }
main { max-width: 1370px; margin: auto; padding: 0 clamp(20px, 5vw, 82px); }
.login {
  min-height: calc(85vh - 76px);
  padding: 44px 0;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(30px, 8vw, 140px);
  align-items: center;
}
.intro { max-width: 535px; }
.intro h1 { font-size: clamp(46px, 6vw, 86px); line-height: 1; letter-spacing: -.065em; margin: 34px 0 22px; font-weight: 650; }
.dot { color: #198477; }
.intro p, .login-card p { color: var(--muted); line-height: 1.6; font-size: 17px; }
.bubble-art { position: relative; width: 92px; height: 62px; }
.bubble-art b, .bubble-art i {
  position: absolute;
  background: #106c66;
  border-radius: 18px 18px 18px 4px;
  width: 66px;
  height: 42px;
  left: 0;
  top: 0;
}
.bubble-art i { left: 38px; top: 25px; width: 45px; height: 30px; background: #79d2bb; box-shadow: 0 0 0 4px var(--paper); border-radius: 12px 12px 3px 12px; }
.bubble-art em { position: absolute; top: 18px; left: 14px; border-radius: 100%; background: #c4efe6; width: 6px; height: 6px; box-shadow: 11px 0 #c4efe6, 22px 0 #c4efe6; }
.login-card { padding: clamp(22px, 4vw, 46px); background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 9px 34px rgba(21, 57, 49, .045); }
h2 { letter-spacing: -.035em; }
.login-card h2 { font-size: 30px; line-height: 1.1; }
.login-card p { font-size: 15px; margin: 10px 0 26px; }
.login-card .primary { width: 100%; margin-top: 14px; display: flex; justify-content: space-between; }
.login-card .error { color: #9c3028; margin: 14px 0 0; font-size: 14px; }
.switch-desk { display: inline-block; font-size: 14px; margin-top: 20px; color: var(--teal); text-underline-offset: 3px; }
.error:empty, .notice:empty { display: none; }

.workspace-heading { padding: 32px 0 20px; }
.tenant { font-weight: 700; color: var(--teal); font-size: 14px; margin-bottom: 5px; }
.workspace-heading h1 { font-size: clamp(32px, 4vw, 50px); letter-spacing: -.06em; line-height: 1.1; }
.channels { display: flex; gap: 5px; flex-wrap: wrap; margin: 0 0 17px; }
.channels button { background: none; font-size: 14px; padding: 9px 13px; color: var(--muted); }
.channels button:hover { background: #e8efe8; }
.channels button[aria-pressed=true] { color: #fff; background: #174d44; }
.channels .unread { margin-left: 4px; }
.notice { padding: 9px 12px; background: #e5f0e9; border-radius: 8px; font-size: 14px; color: #174c44; margin-bottom: 12px; overflow-wrap: anywhere; }
.panes { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(0, 1.65fr); background: white; border: 1px solid var(--line); border-radius: 18px; margin-bottom: 32px; overflow: hidden; }
.panes.single { grid-template-columns: 1fr; }
.panes aside { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-width: 0; }
.list-head { padding: 16px; border-bottom: 1px solid var(--line); }
.list-label { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.list-label h2 { font-size: 17px; }
#count { font-size: 12px; border-radius: 100px; padding: 2px 7px; color: #40584e; background: #eef3ed; }
#search { font-size: 14px; padding: 9px 11px; }
.filters { display: flex; flex-wrap: wrap; gap: 3px; margin: 11px -3px -3px; }
.filters button { background: transparent; font-size: 12px; color: var(--muted); padding: 7px 8px; }
.filters button[aria-pressed=true] { background: var(--mint); color: #0b594a; }
#threads { overflow: auto; flex: 1 1 0; min-height: 220px; }
.thread { display: block; width: 100%; border: 0; border-bottom: 1px solid #e4ebe5; border-radius: 0; background: white; text-align: left; padding: 16px 18px; }
.thread:focus-visible { outline-offset: -4px; }
.thread:hover, .thread[aria-pressed=true] { background: #f0f7f1; }
.thread[aria-pressed=true] { box-shadow: inset 3px 0 #0d8875; }
.thread-top { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 15px; gap: 6px; }
.thread-name { overflow-wrap: anywhere; }
.thread-preview { display: block; margin: 5px 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 400; }
.thread-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 1em; font-size: 11px; font-weight: 450; color: var(--muted); }
.badge { display: inline-block; border-radius: 99px; padding: 3px 7px; font-size: 11px; font-weight: 650; color: #365a53; background: #edf2ed; }
.badge.waiting { background: #fae9cb; color: #704b15; }
.badge.active { background: #d7f0e2; color: #205b4b; }
.unread { flex: none; display: inline-block; border-radius: 99px; min-width: 20px; padding: 2px 6px; background: var(--teal); color: white; text-align: center; font-size: 11px; font-weight: 700; }
.channels button[aria-pressed=true] .unread { background: #dbf7e6; color: #184a40; }
.empty { padding: 23px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: clamp(360px, 56vh, 660px); height: 100%; background: #fcfdfa; }
.center h2 { margin: 8px 0 3px; color: var(--ink); font-size: 20px; }
.small-art { transform: scale(.65); margin: -8px; opacity: .8; }
.back { display: none; }
.chat-head { padding: 16px 20px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.avatar { width: 42px; height: 42px; border-radius: 15px; flex: none; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: #13564a; background: #dbefe1; }
.chat-identity { flex: 1; min-width: 0; }
.chat-head h2 { margin-bottom: 1px; font-size: 19px; overflow-wrap: anywhere; }
#state { color: var(--muted); font-size: 12px; }
.chat-head .outline { font-size: 13px; }
#messages { height: clamp(270px, 44vh, 610px); overflow: auto; padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; background: #fcfdfa; }
#messages:focus-visible { outline-offset: -3px; }
.msg { max-width: 84%; flex-shrink: 0; }
.msg.outgoing { align-self: flex-end; }
.msg p { margin: 0; background: #edf2ed; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.48; border-radius: 14px 14px 14px 4px; font-size: 15px; }
.msg.outgoing p { background: #d8f2e3; border-radius: 14px 14px 4px 14px; }
.msg.bot p { background: #e9f0f4; }
.msg small { display: block; margin: 4px 3px 0; font-size: 11px; color: var(--muted); }
.msg.outgoing small { text-align: right; }
.history-note { margin: auto; font-size: 13px; color: var(--muted); text-align: center; }
small.history-note { margin: 0 auto 8px; }
#reply-form { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; align-items: flex-end; gap: 10px; }
#reply { resize: vertical; min-height: 46px; max-height: 140px; font-size: 15px; }
#send { font-size: 14px; }
.permission { padding: 17px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.5; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; white-space: nowrap; }

@media (max-width: 720px) {
  .bar { min-height: 64px; padding: 10px 16px; }
  .bar nav, .brand { gap: 8px; }
  .brand span { padding-left: 8px; font-size: 12px; }
  .brand img { width: 100px; height: auto; }
  .bar nav button { font-size: 12px; padding: 8px; }
  main { padding: 0 14px; }
  .login { grid-template-columns: 1fr; gap: 23px; padding: 30px 0; }
  .intro h1 { margin: 15px 0 9px; }
  .workspace-heading { padding: 22px 0 15px; }
  .channels { gap: 1px; margin-bottom: 12px; }
  .channels button { padding: 9px 11px; }
  .panes { grid-template-columns: minmax(0, 1fr); border-radius: 13px; }
  .panes aside { border: 0; }
  .panes:not(.has-selection) #detail, .panes.has-selection aside { display: none; }
  .panes.has-selection:not(.single) .back { display: block; margin: 5px 0 0 6px; color: var(--teal); font-size: 13px; }
  .center { min-height: 240px; }
  #threads { max-height: 60vh; flex: auto; }
  #messages { height: clamp(215px, 46vh, 480px); padding: 13px; }
  .chat-head { padding: 12px 14px; }
  #reply-form { padding: 11px; gap: 7px; }
  #send { padding: 11px 13px; }
  #search, #reply { font-size: 16px; }
}
