:root {
  color-scheme: dark;
  --bg: #19262c;
  --side: #202e34;
  --panel: #202e34;
  --code: #142026;
  --border: #314249;
  --text: #e9f0f1;
  --muted: #8da1a9;
  --accent: #8e78fb
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, Arial, sans-serif
}

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

button {
  cursor: pointer
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px
}

a {
  color: #b6b0ff;
  text-decoration: none
}

.app {
  display: flex;
  min-height: 100vh
}

.sidebar {
  width: 220px;
  flex: none;
  background: var(--side);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border)
}

.brand img {
  width: 40px;
  height: 40px;
  display: block;
  margin: 0;
}

.brand {
  font-size: 18px;
  font-weight: 750;
  padding: 0 2px;
}

.nope {
  display: none;
}

.brand-icon {
  color: #9d8aff
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 3px
}

.cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: #afc1c8;
  text-align: left;
  padding: 9px 11px;
  border-radius: 7px
}

.cat:hover,
.cat.chosen {
  background: #34464e;
  color: white
}

.cat small {
  color: #91a5ac
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px
}

.main {
  min-width: 0;
  flex: 1;
  padding: 22px 30px 50px
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg);
  padding-bottom: 16px
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 140px;
  background: #101b20;
  border: 1px solid var(--border);
  padding: 0 14px;
  border-radius: 8px
}

.search-wrap>span {
  font-size: 22px;
  color: var(--muted)
}

.search-wrap input {
  width: 100%;
  background: transparent;
  border: 0;
  color: white;
  outline: 0;
  padding: 12px 0
}

.search-wrap kbd {
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px
}

.toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px
}

.toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap
}

.toggle button.active {
  background: #42525b;
  color: white
}

.primary,
.secondary,
.danger {
  border-radius: 7px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  color: white;
  background: #35474f
}

.primary {
  background: #806cf0;
  border-color: #806cf0
}

.danger {
  background: #6e323b;
  border-color: #6e323b
}

.results {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  padding: 0 0 15px
}

.fav-label {
  cursor: pointer
}

.library.all {
  display: grid;
  gap: 12px
}

.snippet {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 16px;
  min-width: 0
}

.snippet-head,
.snippet-actions,
.code-top,
.modal-header,
.block-header,
.modal-actions,
.block-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between
}

.snippet h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0
}

.snippet-actions {
  justify-content: flex-end;
  flex-wrap: wrap
}

.language {
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #d5c8ff;
  background: #523a83;
  padding: 3px 6px;
  border-radius: 3px
}

.language.css {
  color: #8bbaff;
  background: #234769
}

.language.js,
.language.javascript {
  color: #fbd581;
  background: #73542c
}

.language.php {
  color: #c2b4ff;
  background: #49408b
}

.language.html {
  color: #dca3f5;
  background: #61367c
}

.icon-btn {
  border: 0;
  background: transparent;
  color: #b6c5cb;
  font-size: 18px
}

.starred {
  color: #ffcd65
}

.code-block {
  margin-top: 0px;
  background: var(--code);
  border: 1px solid #283940;
  border-radius: 6px;
  overflow: hidden
}

.code-top {
  padding: 6px 10px;
  border-bottom: 1px solid #293a40
}

.copy {
  border: 0;
  background: transparent;
  color: #c1d1d6;
  font-size: 12px
}

.copy:hover {
  color: white
}

pre {
  margin: 0;
  padding: 13px 14px;
  overflow: auto;
  tab-size: 2;
  color: #a9d7b8;
  font: 12px/1.6 Consolas, 'Courier New', monospace
}

pre code {
  white-space: pre
}

.notes {
  white-space: pre-wrap;
  color: #b5c4ca;
  margin: 10px 0
}

.tags {
  color: #91a9b3;
  font-size: 12px;
  margin-top: 10px;
  white-space: pre-wrap
}

.library.split {
  display: grid;
  grid-template-columns: minmax(190px, 32%) minmax(0, 1fr);
  gap: 12px;
  align-items: start
}

.snippet-list {
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: auto;
  max-height: calc(100vh - 155px);
  position: sticky;
  top: 100px
}

.list-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 13px 14px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  color: white
}

.list-item.selected,
.list-item:hover {
  background: #354a53
}

.list-item strong {
  font-size: 13px;
  font-weight: 550
}

.list-item small {
  color: var(--muted)
}

.snippet-pane {
  min-width: 0
}

.empty {
  padding: 45px;
  text-align: center;
  color: var(--muted)
}

dialog {
  background: var(--panel);
  color: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: min(800px, calc(100vw - 24px));
  max-height: 90vh;
  overflow: auto;
  padding: 24px
}

dialog::backdrop {
  background: #000b
}

dialog h2 {
  margin: 0 0 18px
}

dialog label,
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 10px 0;
  color: #bdcbd0
}

dialog input,
dialog textarea,
dialog select,
.login-card input {
  width: 100%;
  background: #121f24;
  border: 1px solid var(--border);
  color: white;
  border-radius: 6px;
  padding: 10px;
  resize: vertical
}

.form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px
}

.block-header {
  margin: 20px 0 10px
}

.edit-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0
}

.block-controls {
  margin-bottom: 8px
}

.block-controls select {
  width: 170px
}

.code-input {
  font: 13px/1.6 Consolas, monospace;
  tab-size: 2;
  min-height: 130px
}

.modal-actions {
  margin-top: 18px
}

.grow {
  flex: 1
}

#toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #354c54;
  padding: 12px 18px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 20
}

#toast.show {
  opacity: 1
}

.login-page,
.utility-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px
}

.login-card,
.utility-card {
  width: min(520px, 100%);
  padding: 30px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px
}

.login-card button {
  background: var(--accent);
  border: 0;
  color: white;
  padding: 12px 18px;
  border-radius: 6px;
  margin-top: 10px
}

.error {
  color: #ff9da8
}

.success {
  color: #9bdfb2
}

.utility-card form {
  display: grid;
  gap: 15px
}

@media(max-width:900px) {
  .sidebar {
    width: 160px
  }
  .main {
    padding: 16px
  }
  .toolbar {
    flex-wrap: wrap
  }
  .search-wrap {
    flex-basis: 100%;
    order: 2
  }
  .results {
    padding-top: 6px
  }
}

@media(max-width:600px) {
  .app {
    display: block
  }
  .sidebar {
    position: relative;
    height: auto;
    width: 100%;
    padding: 10px
  }
  .sidebar nav {
    flex-direction: row;
    overflow: auto
  }
  .cat {
    white-space: nowrap;
    gap: 8px
  }
  .sidebar-bottom {
    display: none
  }
  .main {
    padding: 12px
  }
  .toolbar {
    top: 0
  }
  .toolbar kbd {
    display: none
  }
  .library.split {
    grid-template-columns: 1fr
  }
  .snippet-list {
    position: static;
    max-height: 190px
  }
  .form-grid {
    grid-template-columns: 1fr
  }
  .snippet-head {
    align-items: flex-start
  }
  .toggle button {
    padding: 7px 9px
  }
}

/* Prism syntax colours, integrated with WhiskRepo dark code panels */

.code-block pre[class*="language-"],
.code-block code[class*="language-"] {
  background: transparent;
  color: #d6dee2;
  text-shadow: none;
  font: 12px/1.6 Consolas, 'Courier New', monospace;
  tab-size: 2
}

.code-block pre[class*="language-"] {
  margin: 0;
  padding: 13px 14px;
  overflow: auto
}

.code-block .token.comment,
.code-block .token.prolog,
.code-block .token.doctype {
  color: #7e939d
}

.code-block .token.keyword,
.code-block .token.atrule {
  color: #c4a7ff
}

.code-block .token.string,
.code-block .token.attr-value {
  color: #a9d7b8
}

.code-block .token.function {
  color: #8dbfff
}

.code-block .token.number,
.code-block .token.boolean {
  color: #f5bd85
}

.code-block .token.selector,
.code-block .token.tag {
  color: #f29aa3
}

.code-block .token.property,
.code-block .token.attr-name {
  color: #8bd4dc
}