:root {
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  color: #1d2e3b;
  background: #fff;
  line-height: 1.45;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #dee4e7;
  padding: 14px max(5vw, 16px);
}
header a,
summary {
  color: #125c60;
  font-weight: 600;
}
.brand {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.brand span {
  display: grid;
  place-items: center;
  background: #155957;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px max(4vw, 16px);
}
h1 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1;
  margin: 0;
  letter-spacing: -0.05em;
}
.intro {
  color: #425662;
  margin: 12px 0 28px;
}
.workspace {
  border: 1px solid #ccd6d9;
  border-radius: 10px;
  overflow: hidden;
}
.toolbar,
.actions,
.editor-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
}
.toolbar {
  border-bottom: 1px solid #d9e1e4;
}
.toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-size: 0.9rem;
}
select,
button {
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  color: inherit;
  border: 1px solid #acbcc0;
  border-radius: 6px;
  background: white;
  padding: 6px 12px;
}
button:hover:enabled,
select:hover {
  background: #edf6f4;
}
button.primary {
  background: #155957;
  color: white;
  border-color: #155957;
  font-weight: 600;
}
button.primary:hover:enabled {
  background: #0b4645;
}
button:disabled {
  cursor: default;
  color: #77868e;
  background: #f5f7f8;
  border-color: #e2e6e7;
}
:focus-visible {
  outline: 2px solid #137576;
  outline-offset: 2px;
}
.editors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.editors > section + section {
  border-left: 1px solid #ccd6d9;
}
.editor-title {
  justify-content: space-between;
  min-height: 48px;
  background: #f5f8f8;
}
h2 {
  font-size: 1rem;
  margin: 0;
}
.editor-title span {
  font-size: 0.8rem;
  color: #526570;
}
.editor {
  display: grid;
  grid-template-columns: auto 1fr;
}
.editor pre,
.editor textarea {
  margin: 0;
  padding: 12px;
  font:
    14px/1.65 ui-monospace,
    Menlo,
    monospace;
  border: none;
  height: clamp(220px, 36vh, 520px);
  tab-size: 4;
}
.editor pre {
  min-width: 2.5rem;
  text-align: right;
  background: #f8fafb;
  color: #697b83;
  overflow: hidden;
  user-select: none;
}
textarea {
  width: 100%;
  resize: none;
  color: #213e4c;
  background: white;
}
textarea:focus-visible {
  outline-offset: -2px;
}
.actions {
  border-top: 1px solid #d9e1e4;
}
.spacer {
  margin-left: auto;
}
#status {
  margin: 0;
  padding: 0 16px 12px;
  color: #34545e;
}
#diagnostics {
  margin: 0;
  padding: 0 16px 12px 36px;
}
#diagnostics:empty {
  display: none;
}
#diagnostics button {
  border: 0;
  background: none;
  text-decoration: underline;
  text-align: left;
  color: #892c24;
}
details {
  margin-top: 20px;
  color: #455761;
  max-width: 82ch;
}
summary {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
@media (max-width: 720px) {
  .editors {
    grid-template-columns: 1fr;
  }
  .editors > section + section {
    border-left: 0;
    border-top: 1px solid #ccd6d9;
  }
  .editor pre,
  .editor textarea {
    height: 190px;
  }
  .toolbar label {
    width: 100%;
    justify-content: space-between;
  }
  .spacer {
    margin-left: 0;
  }
}
.libraries {
  max-width: none;
  margin: 0;
  border-top: 1px solid #d9e1e4;
  padding: 9px 16px;
}
.library-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  max-width: 620px;
  padding: 10px 0;
}
.library-form label {
  font-weight: 600;
  font-size: 0.9rem;
}
.library-form textarea,
.library-form input {
  width: 100%;
  border: 1px solid #bcc9ce;
  border-radius: 5px;
  font:
    14px/1.5 ui-monospace,
    Menlo,
    monospace;
  padding: 6px;
}
.library-form button {
  justify-self: start;
}
#library-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
#library-list li {
  display: flex;
  gap: 8px;
  padding: 5px 0;
}
