:root {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #193832;
  background: #f4f6f3;
  font-size: 15px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  border: 1px solid #c7d7ce;
  border-radius: 9px;
  background: white;
  color: inherit;
  padding: 9px 13px;
  cursor: pointer;
}
button:hover {
  background: #edf4ef;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
textarea,
select {
  border: 1px solid #cad7cf;
  border-radius: 8px;
  padding: 10px;
  max-width: 100%;
  background: white;
  color: inherit;
}
label {
  display: block;
  margin: 10px 0;
}
label > input:not([type="checkbox"]),
label > select {
  display: block;
  width: 100%;
  margin-top: 5px;
}
header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 28px;
  border-bottom: 1px solid #dbe4dd;
  background: white;
}
.brand {
  font-size: 22px;
  font-weight: 750;
  text-decoration: none;
  color: #196b54;
}
header details {
  margin-left: auto;
}
header details[open] {
  max-width: 480px;
}
h1,
h2,
h3 {
  line-height: 1.2;
}
h2 {
  font-size: 19px;
}
p {
  line-height: 1.5;
}
.shell {
  display: grid;
  grid-template-columns: 160px 280px minmax(0, 1fr);
  min-height: calc(100vh - 90px);
}
nav {
  padding: 24px 12px;
  background: #eef2ed;
}
nav button {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  background: transparent;
  margin-bottom: 8px;
}
nav button.active {
  background: #dce9df;
  font-weight: 650;
}
aside {
  background: #fafcf9;
  border-right: 1px solid #dbe4dd;
  padding: 20px;
  overflow: auto;
}
main {
  padding: 28px;
  max-width: 1400px;
  min-width: 0;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.chat-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 12px;
  margin: 8px 0;
}
.chat-row.selected {
  border-color: #27785b;
  background: #eaf3eb;
}
.muted,
small {
  color: #63796d;
}
.empty {
  text-align: center;
  max-width: 520px;
  margin: 15vh auto;
}
.messages {
  min-height: 240px;
  max-height: 56vh;
  overflow: auto;
  padding: 12px 0;
}
.message {
  background: white;
  border: 1px solid #dce5dd;
  border-radius: 14px;
  padding: 14px 18px;
  max-width: 85%;
  margin: 12px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message.human {
  margin-left: auto;
  background: #e8f2e8;
}
.message.system {
  background: none;
  border: 0;
  font-size: 13px;
  color: #607469;
}
.message small {
  display: block;
  margin-bottom: 7px;
}
.composer {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-top: 18px;
}
.composer textarea {
  flex: 1;
  resize: vertical;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}
.card {
  background: white;
  border: 1px solid #d8e3d9;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 14px;
}
.card button {
  margin: 5px 5px 0 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  background: white;
}
th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #dbe4dd;
}
#notice {
  margin: 0;
  padding: 0 28px;
  color: #8d392f;
}
#notice:not(:empty) {
  padding: 12px 28px;
  background: #fff3e5;
}
dialog {
  border: 1px solid #c7d7ce;
  border-radius: 18px;
  padding: 28px;
  width: min(460px, 90vw);
}
dialog::backdrop {
  background: #163c3055;
}
pre {
  white-space: pre-wrap;
}
.device-image {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #1b3027;
  border-radius: 12px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 850px) {
  .shell {
    grid-template-columns: 1fr;
  }
  nav {
    display: flex;
    overflow: auto;
    padding: 8px;
  }
  nav button {
    width: auto;
    white-space: nowrap;
    margin: 0;
  }
  aside {
    border-right: 0;
    border-bottom: 1px solid #dbe4dd;
    padding: 16px;
  }
  main {
    padding: 18px;
  }
  header {
    padding: 14px;
    gap: 12px;
  }
  #chat-list {
    display: flex;
    overflow: auto;
    gap: 8px;
  }
  .chat-row {
    min-width: 180px;
  }
  aside label {
    display: inline-block;
    max-width: 55%;
  }
  .messages {
    max-height: 50vh;
  }
  .message {
    max-width: 96%;
  }
  .composer {
    flex-wrap: wrap;
  }
  .composer textarea {
    min-width: 65%;
  }
}

.shell.single {
  grid-template-columns: 160px minmax(0, 1fr);
}
@media (max-width: 850px) {
  .shell.single {
    grid-template-columns: 1fr;
  }
}
