*, *::before, *::after {
   box-sizing: border-box; 
}

* {
    margin: 0;
    padding: 0;
    font: inherit;
    user-select: none;
    scrollbar-width: none;
}

::-webkit-scrollbar {
    display: none;
}

:root {
    --color-primary: hsl(120, 100%, 40%);
    --color-primary-100: hsl(120, 100%, 72%);
    --color-primary-200: hsl(120, 100%, 64%);
    --color-primary-300: hsl(120, 100%, 56%);
    --color-primary-400: hsl(120, 100%, 48%);
    --color-primary-500: hsl(120, 100%, 40%);
    --color-primary-600: hsl(120, 100%, 32%);
    --color-primary-700: hsl(120, 100%, 24%);
    --color-primary-800: hsl(120, 100%, 16%);
    --color-primary-900: hsl(120, 100%, 8%);

    --color-secondary: hsl(264, 100%, 50%);
    --color-secondary-100: hsl(264, 100%, 90%);
    --color-secondary-200: hsl(264, 100%, 80%);
    --color-secondary-300: hsl(264, 100%, 70%);
    --color-secondary-400: hsl(264, 100%, 60%);
    --color-secondary-500: hsl(264, 100%, 50%);
    --color-secondary-600: hsl(264, 100%, 40%);
    --color-secondary-700: hsl(264, 100%, 30%);
    --color-secondary-800: hsl(264, 100%, 20%);
    --color-secondary-900: hsl(264, 100%, 10%);

    --color-tertiary: hsl(12, 100%, 50%);
    --color-tertiary-100: hsl(12, 100%, 90%);
    --color-tertiary-200: hsl(12, 100%, 80%);
    --color-tertiary-300: hsl(12, 100%, 70%);
    --color-tertiary-400: hsl(12, 100%, 60%);
    --color-tertiary-500: hsl(12, 100%, 50%);
    --color-tertiary-600: hsl(12, 100%, 40%);
    --color-tertiary-700: hsl(12, 100%, 30%);
    --color-tertiary-800: hsl(12, 100%, 20%);
    --color-tertiary-900: hsl(12, 100%, 10%);

    font-family: system-ui;
    font-size: 62.5%
}

html {
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #ccc;
    font-size: 1.6rem;
}

p {
    line-height: 1.5;
}

.selectable {
    user-select: all;
    cursor: pointer;
}

a[href] {
    color: #0066ff;
    text-decoration: underline;
    text-underline-offset: 0.4rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
    word-break: break-all;
}

button {
    border: none;
    outline: none;
    background: inherit;
    cursor: pointer;
}

input {
    border: none;
    outline: none;
    background: inherit;
    color: inherit;
}

#app {
}

.page {
    display: flex;
    flex-direction: column;
    max-width: 56rem;
    width: 100%;
    height: 100dvh;
    margin-inline: auto;
    background-color: white;
}

.page-header {
    height: 5.6rem;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    flex-direction: row;
    gap: 1.6rem;
    align-items: center;
    padding-inline: 1.6rem;
    font-size: 1.2em;
    font-weight: 600;
}

.page-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 3.2rem 1.6rem;
    overflow-y: scroll;
}

.page-footer {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    padding: 1.6rem;
}

.icon {
    min-width: 3.2rem;
    min-height: 3.2rem;
    background-size: 3.2rem;
    background-position: center;
    background-repeat: no-repeat;
}

.icon.small {
    min-width: 1.6rem;
    min-height: 1.6em;
    background-size: 1.6rem;
}

.icon.close {
    background-image: url(../img/icons/close.svg);
}

.icon.close-light {
    background-image: url(../img/icons/close-light.svg);
}

.icon.filter {
    background-image: url(../img/icons/filter.svg);
}

.icon.back {
    background-image: url(../img/icons/back.svg);
}

.icon.edit {
    background-image: url(../img/icons/edit.svg);
}

.icon.delete {
    background-image: url(../img/icons/delete.svg);
}

.icon.add {
    background-image: url(../img/icons/add.svg);
}

.icon.add-gray {
    background-image: url(../img/icons/add-gray.svg);
}

.icon.link {
    background-image: url(../img/icons/link.svg);
}

.icon.nut {
    background-image: url(../img/icons/nut.svg);
}

.icon.tags {
    background-image: url(../img/icons/tags.svg);
}

.icon.random {
    background-image: url(../img/icons/random.svg);
}

.icon.piggy {
    background-image: url(../img/icons/piggy.svg);
}

.icon.stats {
    background-image: url(../img/icons/stats.svg);
}

.icon.ellipsis {
    background-image: url(../img/icons/ellipsis.svg);
}

.icon.filter[data-count] {
    position: relative;
}

.icon.filter[data-count]::after {
    position: absolute;
    right: 0;
    top: 0;
    display: grid;
    place-items: center;
    content: attr(data-count);
    width: 1.4em;
    height: 1.4em;
    border-radius: 100%;
    font-size: 0.6em;
    color: white;
    background-color: var(--color-secondary);
}

.color-primary {
    --color: var(--color-primary);
}

.color-secondary {
    --color: var(--color-secondary);
}

.color-tertiary {
    --color: var(--color-tertiary);
}

.hidden {
    visibility: hidden;
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

label span.error {
    display: none;
    font-size: 0.8em;
    font-weight: 700;
    color: red;
}

label.error span.error {
    display: block;
}

.text-input {
    height: 4.8rem;
    background-color: #aaa;
    color: white;
    font-weight: 600;
    padding-inline: 1.6rem;
    border-radius: 0.8rem;
}

label.error .text-input {
    border: 0.2rem solid red;
}

::placeholder {
    color: #777;
}

.button {
    height: 4.8rem;
    flex-shrink: 0;
    color: white;
    background-color: var(--color);
    font-weight: 600;
    border-radius: 0.8rem;
    padding-inline: 1.6rem;
}

.button.primary {
    background-color: var(--color);
}

.button.secondary {
    background-color: transparent;
    color: var(--color);
    border: 0.2rem solid var(--color);
}

.circle {
    border-radius: 100%;
    width: 5.6rem;
    height: 5.6rem;
    background-color: var(--color);
}

.small-circle {
    border-radius: 100%;
    width: 4.8rem;
    height: 4.8rem;
    background-color: var(--color);
}

.big-circle {
    border-radius: 100%;
    width: 8.4rem;
    height: 8.4rem;
    background-color: var(--color);
}

.text-center {
    text-align: center;
}

.small-text {
    font-size: 0.8em;
}

.gray-text {
    color: #777;
}

.bold {
    font-weight: 700;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-row {
    display: flex;
    flex-direction: row;
}

.flex-1 {
    flex: 1;
}

.content-center {
    justify-content: center;
}

.items-center {
    align-items: center;
}

.margin-auto {
    margin: auto;
}

.margin-bottom-16 {
    margin-bottom: 1.6rem;
}

.margin-bottom-32 {
    margin-bottom: 3.2rem;
}

.gap-4 {
    gap: 0.4rem;
}

.gap-8 {
    gap: 0.8rem;
}

.gap-16 {
    gap: 1.6rem;
}

.gap-32 {
    gap: 3.2rem;
}

.padding-8 {
    padding: 0.8rem;
}

.padding-16 {
    padding: 1.6rem;
}

.padding-32 {
    padding: 3.2rem;
}

.modal-backdrop {
    display: grid;
    place-items: center;
    position: fixed;
    inset: 0;
    background-color: rgb(0, 0, 0, 0.5);
    padding: 1.6rem;
    z-index: 1000;
}

.modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: calc(56rem - 2 * 1.6rem);
    max-height: 100%;
    padding: 1.6rem;
    overflow: hidden;
    background-color: white;
    border-radius: 1.6rem;
}

.modal-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding-bottom: 1.6rem;
    border-bottom: 0.1rem solid #ccc;
}

.modal-header .close {
    margin-left: auto;
}

.modal-title {
    font-size: 1.2em;
    font-weight: 600;
}

.modal-body {
    display: flex;
    flex-direction: column;
    padding-block: 1.6rem;
    overflow: scroll;
}

.modal-footer {
    display: flex;
    flex-direction: row;
    gap: 0.8rem;
    padding-top: 1.6rem;
}

.modal-footer button {
    flex: 1;
}

.loading {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 2000;
    background-color: rgb(0, 0, 0, 0.5);
}

.loading img {
    width: 6rem;
    height: 6rem;
    animation: loading 1s ease infinite;
}

@keyframes loading {
    to {
        transform: rotate(360deg);
    }
}

.tags {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.tag-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: 0.8em;
    gap: 0.8rem;
    font-weight: 600;
    background-color: #aaa;
    color: white;
    height: 3.6rem;
    padding-inline: 1.6rem;
    border-radius: 1.6rem;
}

.tag.selected {
    background-color: var(--color-secondary);
}

.add-tag {
}

.tag-hint,
.tag-input {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: 4.8rem;
    padding-inline: 1.6rem;
    color: white;
    background-color: #aaa;
    font-weight: 600;
}

.tag-hint {
    border-top: 0.1rem solid #777;
}

.tag-input input {
    flex: 1;
}
