:root {
  font-family: Inter, "PingFang SC", "Microsoft Yahei", sans-serif;
  color: #243d41;
  background: #edf2f1;
  --accent: #117e70;
  --border: #e2e9e6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: var(--accent);
  color: white;
  padding: 11px 17px;
  border-radius: 10px;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.secondary {
  background: #eef4f1;
  color: #30554f;
}
button.danger {
  background: #aa423f;
}
input,
textarea,
select {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px;
  background: white;
  color: inherit;
  max-width: 100%;
}
label {
  display: block;
  margin: 15px 0;
}
label input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  margin-top: 8px;
}
a {
  color: var(--accent);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h2 {
  font-size: 20px;
}
small,
.muted {
  color: #71847f;
  font-size: 13px;
  line-height: 1.7;
}
[hidden] {
  display: none !important;
}
.login {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9vw;
  padding: 40px;
  background: radial-gradient(ellipse at 10% 10%, #d4e9df, transparent 60%);
}
.brand {
  font-weight: bold;
  font-size: 27px;
}
.intro h1 {
  font-size: 52px;
  line-height: 1.35;
  font-weight: 600;
  margin: 54px 0 25px;
}
.intro p {
  color: #668078;
}
.login-card {
  background: white;
  border: 1px solid white;
  border-radius: 24px;
  padding: 32px;
  width: 385px;
  box-shadow: 0 24px 90px #235e3810;
  text-align: center;
}
.login-card canvas {
  width: 228px !important;
  height: 228px !important;
  display: block;
  margin: auto;
}
.login-card details {
  text-align: left;
  border-top: 1px solid var(--border);
  padding: 18px 0;
  margin-top: 20px;
}
.login-card form button {
  width: 100%;
}
summary {
  cursor: pointer;
}
.workspace {
  height: 100dvh;
  display: grid;
  grid-template-columns: 92px 310px minmax(0, 1fr);
  max-width: 1800px;
  margin: auto;
  background: white;
}
.rail {
  background: #163f39;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 9px;
}
.rail strong {
  text-align: center;
  font-size: 21px;
  margin: 5px 0 30px;
}
.rail button {
  background: transparent;
  font-size: 13px;
  padding: 14px 3px;
  border-radius: 9px;
  color: #d5e4df;
}
.rail button.selected {
  background: #ffffff20;
  color: white;
}
.rail span:not(:empty) {
  display: inline-block;
  background: #d36557;
  color: white;
  border-radius: 8px;
  font-size: 11px;
  padding: 1px 4px;
  margin-left: 3px;
}
.spacer {
  flex: 1;
}
.list-panel {
  border-right: 1px solid var(--border);
  overflow: auto;
  padding: 22px 14px;
}
.list-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.list-panel input {
  width: 100%;
  margin: 8px 0 16px;
  background: #f5f7f6;
}
.list-panel #list-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.list-panel button {
  font-size: 13px;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  width: 100%;
  color: inherit;
  background: white;
  text-align: left;
  padding: 14px 9px;
  cursor: pointer;
  border-radius: 10px;
}
.list-row:hover,
.list-row.active {
  background: #e9f3ee;
}
.avatar {
  flex-shrink: 0;
  width: 43px;
  height: 43px;
  background: #e0eee5;
  color: #367969;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 600;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.row-content {
  min-width: 0;
  flex: 1;
}
.row-content strong,
.row-content small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge {
  background: #d35d54;
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
}
.main {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.welcome {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #f7faf8;
}
.welcome-icon {
  padding: 24px;
  background: #e4f0e7;
  border-radius: 28px;
  font-size: 35px;
  color: #287360;
  margin-bottom: 20px;
}
#chat {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.chat-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.chat-header h2 {
  margin-bottom: 4px;
}
.chat-header button {
  font-size: 12px;
}
.messages {
  flex: 1;
  overflow: auto;
  padding: 20px 30px;
  background: #f5f8f6;
}
.messages > #older {
  display: block;
  margin: 0 auto 20px;
}
.message {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.message.mine {
  align-items: flex-end;
}
.message .bubble {
  background: white;
  box-shadow: 0 1px 3px #19352708;
  padding: 12px 16px;
  max-width: 78%;
  border-radius: 3px 14px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}
.message.mine .bubble {
  background: #dceee2;
  border-radius: 14px 3px 14px 14px;
}
.message small {
  font-size: 11px;
}
.message img {
  max-width: min(320px, 100%);
  max-height: 300px;
  border-radius: 8px;
  display: block;
}
.message audio {
  max-width: 100%;
}
.message .message-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.message button {
  font-size: 11px;
  padding: 3px 6px;
  background: transparent;
  color: #658077;
}
.composer {
  border-top: 1px solid var(--border);
  padding: 12px 24px 20px;
}
.toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar button {
  font-size: 12px;
  padding: 7px 10px;
}
#send-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 10px;
}
textarea {
  resize: vertical;
  min-height: 70px;
  max-height: 180px;
  flex: 1;
  outline-color: var(--accent);
}
dialog {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  max-width: min(650px, 94vw);
  width: 540px;
  max-height: 90dvh;
  color: inherit;
}
dialog::backdrop {
  background: #173e3660;
}
dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
dialog header h2 {
  margin: 0;
}
.detail {
  padding: 28px;
  height: 100%;
  overflow: auto;
}
.detail .card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.button-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.videos {
  position: relative;
  background: #173e36;
  border-radius: 12px;
  overflow: hidden;
  min-height: 160px;
}
.videos #remote-video {
  width: 100%;
  max-height: 50vh;
}
.videos #local-video {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 25%;
  background: #254f46;
}
#call-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
#toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: #263f39;
  color: white;
  border-radius: 10px;
  padding: 12px 20px;
  max-width: 90vw;
  display: none;
}
#back {
  display: none;
}
.state-error {
  color: #b34545;
}
.empty {
  padding: 30px 8px;
  color: #7b8b85;
  text-align: center;
}
@media (max-width: 1000px) {
  .workspace {
    grid-template-columns: 76px 245px minmax(0, 1fr);
  }
  .chat-header {
    padding: 12px;
    flex-wrap: wrap;
  }
  .chat-header button {
    padding: 8px;
  }
  .intro h1 {
    font-size: 38px;
  }
  .login {
    gap: 5vw;
  }
}
@media (max-width: 700px) {
  .login {
    padding: 20px;
  }
  .intro {
    display: none;
  }
  .workspace {
    grid-template-columns: 70px 1fr;
  }
  .main {
    display: none;
  }
  .workspace.open-chat .list-panel {
    display: none;
  }
  .workspace.open-chat .main {
    display: block;
  }
  #back {
    display: block;
  }
  .messages {
    padding: 16px;
  }
  .composer {
    padding: 12px;
  }
  .message .bubble {
    max-width: 90%;
  }
  .rail {
    padding: 16px 5px;
  }
  .rail strong {
    font-size: 18px;
  }
  .login-card {
    padding: 22px;
    width: 100%;
  }
}
