:root {
  color-scheme: light;
  --bg: #f5f7f5;
  --panel: #ffffff;
  --ink: #17211d;
  --muted: #63726b;
  --line: #dde6e1;
  --brand: #10a37f;
  --brand-dark: #08785e;
  --soft: #e7f6f1;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--line);
  background: #fbfdfc;
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-size: 1.35rem;
  font-weight: 800;
}

.brand strong,
.brand span,
.profile-field {
  display: block;
}

.brand span,
.profile-field,
.notice p,
.chat-header p {
  color: var(--muted);
}

.profile-field {
  font-size: 0.9rem;
  font-weight: 700;
}

.profile-field input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  outline: none;
}

.profile-field input:focus,
.composer textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.14);
}

.channel-list {
  display: grid;
  gap: 8px;
}

.channel-list button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 12px;
  text-align: left;
}

.channel-list button[aria-current="true"] {
  background: var(--soft);
  color: var(--brand-dark);
  font-weight: 800;
}

.notice {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
}

.notice p,
.chat-header p {
  margin: 4px 0 0;
  line-height: 1.45;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf9 100%);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px 24px;
}

.chat-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

.chat-header button,
.composer button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  font-weight: 800;
  padding: 11px 16px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 24px;
}

.empty {
  margin: auto;
  max-width: 360px;
  color: var(--muted);
  text-align: center;
}

.message {
  max-width: min(680px, 88%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 11px 13px;
  box-shadow: 0 10px 30px rgba(23, 33, 29, 0.05);
}

.message.mine {
  align-self: flex-end;
  border-color: #bde9dc;
  background: var(--soft);
}

.message-meta {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.message p {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.composer textarea {
  min-height: 48px;
  max-height: 140px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  outline: none;
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px;
  }

  .channel-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .channel-list button {
    white-space: nowrap;
  }

  .notice {
    display: none;
  }

  .chat-panel {
    min-height: calc(100vh - 210px);
  }

  .chat-header,
  .messages {
    padding: 14px;
  }

  .message {
    max-width: 94%;
  }
}
