:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-muted: #eef1f5;
  --text: #1f2933;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --focus: #2563eb;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  min-height: 36px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

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

.iconButton {
  width: 36px;
  padding: 0;
  font-size: 20px;
}

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

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  padding: 16px;
}

.settingsPanel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto minmax(160px, auto);
  align-items: end;
  gap: 12px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 8px 10px;
}

textarea {
  min-height: 116px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

#statusOutput {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
}

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

.tab {
  background: var(--panel-muted);
  color: var(--text);
}

.tab.active {
  background: var(--accent);
  color: white;
}

.workspace {
  display: none;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 14px;
  min-height: calc(100vh - 210px);
}

.workspace.active {
  display: grid;
}

.listPane,
.editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.listPane {
  overflow: hidden;
}

.paneHeader,
.editorHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin: 0;
  font-size: 16px;
}

.filterLabel {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.list {
  display: grid;
  max-height: calc(100vh - 285px);
  overflow: auto;
}

.listItem {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: white;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.listItem:hover,
.listItem.active {
  background: #e9f7f5;
  color: var(--text);
}

.listItem strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.listItem span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.editor {
  display: grid;
  align-content: start;
  gap: 16px;
  padding-bottom: 16px;
}

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

.grid {
  display: grid;
  gap: 12px;
  padding: 0 16px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.codeGrid textarea {
  min-height: 150px;
}

.messageText {
  min-height: 180px;
  margin: 0 16px;
  width: calc(100% - 32px);
  font-family: inherit;
  font-size: 14px;
}

@media (max-width: 860px) {
  .settingsPanel,
  .workspace,
  .two,
  .three,
  .four {
    grid-template-columns: 1fr;
  }

  .list {
    max-height: 280px;
  }
}
