:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

main {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

.subheading {
  margin-top: 18px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar p {
  margin-top: 6px;
  color: #5e6b78;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 650;
  color: #3f4b57;
}

.note {
  margin-top: 14px;
  color: #5e6b78;
  font-size: 13px;
  line-height: 1.45;
}

.hidden {
  display: none;
}

input,
select,
textarea,
button {
  width: 100%;
  border: 1px solid #c7d0d9;
  border-radius: 6px;
  font: inherit;
}

input,
select,
textarea {
  min-height: 38px;
  padding: 8px 10px;
  background: #fff;
  color: #17202a;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

button {
  min-height: 38px;
  padding: 8px 12px;
  background: #176b87;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.actions.two,
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.nickserv-row {
  align-items: end;
}

.status {
  min-width: 150px;
  border-radius: 999px;
  padding: 8px 12px;
  text-align: center;
  font-weight: 750;
  border: 1px solid transparent;
}

.status.loading {
  background: #fff7d6;
  color: #684e00;
  border-color: #f1d87d;
}

.status.ready,
.status.success {
  background: #e8f7ee;
  color: #17613a;
  border-color: #9fd7b7;
}

.status.error {
  background: #fdecec;
  color: #872323;
  border-color: #efb2b2;
}

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 12px;
  margin: 16px 0 0;
}

dt {
  color: #5e6b78;
  font-weight: 700;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th,
td {
  border-bottom: 1px solid #e2e7ec;
  padding: 8px;
  text-align: left;
  overflow-wrap: anywhere;
}

pre,
.logs,
.irc-messages {
  min-height: 180px;
  margin: 12px 0 0;
  padding: 12px;
  overflow: auto;
  border-radius: 6px;
  background: #101820;
  color: #e9f0f5;
}

.logs {
  height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.irc-messages {
  height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.irc-line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  overflow-wrap: anywhere;
}

.irc-time {
  color: #94a3b8;
}

.irc-line.irc-out {
  color: #b8f7d4;
}

.irc-line.irc-status {
  color: #f7e6a7;
}

.irc-line.irc-error {
  color: #ffb4b4;
}

@media (max-width: 760px) {
  main {
    width: min(100vw - 20px, 1180px);
    padding-top: 14px;
  }

  .topbar,
  .grid,
  .actions,
  .actions.two,
  .split {
    grid-template-columns: 1fr;
    display: grid;
  }
}
