* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #121318;
  color: #ececf2;
  font:
    14px system-ui,
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  background: #292b35;
  border: 1px solid #393b48;
  border-radius: 8px;
  padding: 10px;
}
input,
select {
  background: #121318;
  color: inherit;
  border: 1px solid #393b48;
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
  font-size: 16px;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 180px;
  background: #171820;
  padding: 24px 12px;
  border-right: 1px solid #292b35;
}
aside button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 5px 0;
  background: none;
  border: 0;
}
button.active {
  background: #302b43;
  color: #c3baf0;
}
main {
  margin-left: 180px;
  padding: 30px;
  max-width: 1100px;
}
h1 {
  margin: 6px 0 20px;
  font-size: 30px;
}
h2 {
  font-size: 15px;
  margin: 0;
}
small {
  color: #9698a8;
}
.panel {
  background: #1b1d25;
  border: 1px solid #2c2e38;
  border-radius: 13px;
  padding: 16px;
  margin-bottom: 12px;
}
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border-bottom: 1px solid #2c2e38;
}
.row:last-child {
  border: 0;
}
.grow {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.count {
  font-size: 27px;
  color: #c3baf0;
  margin: 8px 0;
}
.link {
  background: none;
  border: 0;
  color: #c3baf0;
  padding: 5px;
}
.primary {
  background: #c3baf0;
  color: #252136;
  border: 0;
}
.quick {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.quick input {
  flex: 1;
}
.tags {
  color: #aeb0be;
  font-size: 12px;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
footer {
  display: none;
}
.done {
  text-decoration: line-through;
  color: #888;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.check {
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
}
.check.on {
  color: #a9cbb8;
}
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.tabs button {
  flex: 1;
}
dialog {
  background: #22242e;
  color: #eee;
  border: 1px solid #444;
  border-radius: 14px;
  width: min(90%, 380px);
}
dialog::backdrop {
  background: #0009;
}
dialog form {
  display: grid;
  gap: 10px;
}
:root {
  color-scheme: dark;
}
.home .panel > p {
  margin: 8px 0;
}
:focus-visible {
  outline: 2px solid #c3baf0;
  outline-offset: 2px;
}
@media (max-width: 650px), (max-width: 950px) and (pointer: coarse) {
  :root {
    --dock-height: calc(62px + env(safe-area-inset-bottom));
  }
  aside {
    display: none;
  }
  main {
    margin: 0;
    padding: max(12px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right)) calc(var(--dock-height) + 12px)
      max(14px, env(safe-area-inset-left));
  }
  .cols {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .panel {
    padding: 12px;
    margin-bottom: 9px;
  }
  h1 {
    font-size: 25px;
    margin: 4px 0 12px;
  }
  .count {
    font-size: 23px;
    margin: 4px 0;
  }
  .row {
    min-height: 35px;
    font-size: 13px;
  }
  footer {
    display: block;
    position: fixed;
    inset: auto 0 0;
    height: var(--dock-height);
    background: #191b23;
    border-top: 1px solid #333;
    padding: 5px max(3px, env(safe-area-inset-right))
      env(safe-area-inset-bottom) max(3px, env(safe-area-inset-left));
    z-index: 2;
  }
  footer nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: 100%;
  }
  footer button {
    border: 0;
    background: none;
    font-size: 11px;
    min-width: 0;
    padding: 3px 0;
  }
  footer b {
    display: block;
    font-size: 21px;
    font-weight: 400;
    margin-bottom: 3px;
  }
  footer button.active {
    background: none;
    color: #c3baf0;
  }
}
@media (max-width: 650px) and (max-height: 770px) {
  .home h1 {
    margin-bottom: 7px;
  }
  .home .panel {
    padding: 9px;
    margin-bottom: 7px;
  }
  .home .row {
    min-height: 30px;
  }
  .home .check {
    height: 27px;
  }
  .home .count {
    font-size: 20px;
  }
}
@media (orientation: landscape) and (max-height: 500px) and ((max-width: 650px) or ((max-width: 950px) and (pointer: coarse))) {
  .home .cols {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .home .panel {
    padding: 8px;
    margin-bottom: 6px;
  }
  .home h1 {
    font-size: 20px;
    margin: 2px 0 5px;
  }
  .home .count {
    font-size: 17px;
    margin: 2px 0;
  }
  .home .row {
    min-height: 24px;
  }
  .home .check {
    height: 22px;
  }
  .home .quick {
    margin-top: 5px;
  }
  .home .quick input,
  .home .quick button {
    padding: 5px 8px;
  }
  .home .tags {
    margin-top: 4px;
  }
}

@media (max-width: 650px) and (max-height: 720px) {
  .home .panel {
    padding: 8px;
  }
  .home .row {
    min-height: 27px;
  }
  .home .check {
    height: 25px;
  }
  .home .quick {
    margin-top: 6px;
  }
  .home .quick input,
  .home .quick button {
    padding: 7px 9px;
  }
  .home .tags {
    margin-top: 5px;
  }
}

@media (orientation: landscape) and (max-height: 370px) and ((max-width: 650px) or ((max-width: 950px) and (pointer: coarse))) {
  .home {
    display: grid;
    grid-template-columns: 2fr 1fr;
    column-gap: 9px;
  }
  .home header,
  .home h1 {
    grid-column: 1 / -1;
  }
}
