@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&display=swap");

*,
::before,
::after {
  font-family: "Noto Sans Mono", monospace;
  font-size: 1rem;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  line-height: 1.75;
  outline: 0;
}

[v-cloak] {
  visibility: hidden;
}

body {
  overflow-y: scroll;
}

#app {
  grid-template-columns: 100%;
  grid-template-areas: "aside main";
}

aside {
  grid-area: aside;
}

main,
aside {
  padding: 1.5rem;
}

main {
  width: 100%;
  max-width: 1200px;
  grid-area: main;
  margin: 0 auto;
}

@media (min-width: 720px) {
  #app {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-areas: "aside main";
  }

  aside {
    position: sticky;
    align-self: start;
    top: 0;
    height: 100vh;
  }
}

p,
h2,
h3,
select,
label,
input:not([type="checkbox"]),
form,
section,
textarea,
pre,
header {
  display: block;
  margin: 0 0 1rem;
}

details[open] summary {
  margin: 0 0 1rem;
}

h2 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

h2:not(:empty)::before {
  content: "# ";
}

menu {
  list-style-type: "› ";
  list-style-position: inside;
}

a,
button {
  text-decoration: none;
  color: rgb(0, 0, 238);
}

a:hover,
button:hover {
  color: rgb(0, 0, 160);
}

a:disabled,
button:disabled {
  color: rgb(0, 0, 238, 0.6) !important;
}

:disabled {
  cursor: not-allowed;
}

button {
  border: 0;
  background: none !important;
  cursor: pointer;
}

button:not(:has(> *))::before {
  content: "[";
}

button:not(:has(> *))::after {
  content: "]";
}

/* grid */

[role="grid"] {
  display: grid;
  width: 100%;
  grid-template-columns: auto max-content;
  column-gap: 1rem;
}

[role="grid"] > div,
[role="grid"] > td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[role="grid"] > :is(div, td):nth-child(even) {
  text-align: right;
}

/* table */

section:has(> table) {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  font-weight: 600;
}

td,
th {
  vertical-align: top;
  padding: 0 1rem;
  text-align: left;
  border: 1px solid #000;
}

select,
input:not([type="checkbox"]),
textarea {
  appearance: none;
  background: none;
  width: 100%;
  border: 1px solid #000;
  padding: 0 0.5rem;
}

input[type="checkbox"] {
  accent-color: #00e;
}

[list]::-webkit-calendar-picker-indicator {
  display: none !important;
}

progress {
  height: 4px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  border: 0;
  width: 2rem;

  aspect-ratio: 4;
  background: radial-gradient(circle closest-side, #000 90%, #0000) 0 / calc(100% / 3) 100% space;
  clip-path: inset(0 100% 0 0);
  animation: l1 1s steps(4) infinite;
}

progress:before {
  content: "";
  display: inline-block;
}

progress::-moz-progress-bar {
  background: none;
}

@keyframes l1 {
  to {
    clip-path: inset(0 -34% 0 0);
  }
}

:is(textarea, pre) {
  min-width: 100%;
  resize: vertical;
  border: 1px solid #000;
  padding: 1rem;
  overflow: auto;
}

/* dialog */

dialog {
  width: 100%;
  max-width: 680px;
  margin: auto;
  translate: 0 -10vh;
}

dialog > div {
  padding: 1rem;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
}

dialog > div > *:last-child {
  margin-bottom: 0;
}

/* dropdown */

button:has(> menu)::before,
button:has(> i:empty)::before {
  content: "⋯";
}

button:has(menu) {
  position: relative;
  color: #000;
  font-weight: bold;
}

button menu {
  display: none;
  position: absolute;
  top: calc(100% - 5px);
  left: 0;
  background: #fff;
  border: 1px solid #000;
  padding: 1rem;
  text-align: left;
}

button menu li {
  white-space: nowrap;
}

button:hover > menu {
  display: block;
}
