:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #66747f;
  --line: #dce3e8;
  --blue: #1c6dd0;
  --green: #168466;
  --red: #b42318;
  --shadow: 0 8px 24px rgba(17, 31, 44, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 700;
}

h2 {
  font-size: 16px;
  font-weight: 650;
}

#statusText {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.3fr) minmax(320px, 1fr);
  gap: 16px;
  padding: 16px;
  max-width: 1280px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.full {
  grid-column: 1 / -1;
}

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.buttonRow {
  display: flex;
  gap: 8px;
}

button {
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.95);
}

.iconButton {
  width: 38px;
  padding: 0;
  font-size: 19px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
  margin-top: 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.checkboxRow {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkboxRow input {
  width: auto;
}

.statusLine {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--muted);
  font-size: 13px;
  background: #fbfcfd;
  margin-bottom: 10px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
}

.wideGrid2 {
  grid-template-columns: 1fr 1fr;
}

.chatPanel {
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.chatLog {
  flex: 1;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  overflow: auto;
  background: #fbfcfd;
}

.message {
  max-width: 82%;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message.in {
  background: #eaf2ff;
  margin-left: auto;
}

.message.out {
  background: #eef8f4;
  border: 1px solid #d1eadf;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.composer {
  display: grid;
  grid-template-columns: 150px 1fr 72px;
  gap: 10px;
  margin-top: 12px;
}

.list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.itemHeader {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.itemTitle {
  font-weight: 650;
}

.danger {
  background: var(--red);
}

.eventList {
  display: grid;
  gap: 8px;
}

.event {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfd;
}

@media (max-width: 880px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .grid2,
  .wideGrid2 {
    grid-template-columns: 1fr;
  }
}
