:root {
    color-scheme: light dark;

    --background: #f5f5f7;
    --card: #ffffff;
    --text: #171719;
    --secondary: #77777d;
    --border: #e6e6e8;
    --button: #e9e9ed;
    --button-active: #171719;
    --button-active-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #0c0c0e;
        --card: #18181b;
        --text: #f5f5f7;
        --secondary: #99999f;
        --border: #29292d;
        --button: #242428;
        --button-active: #f5f5f7;
        --button-active-text: #111113;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input {
    font: inherit;
}

.app {
    width: min(100%, 720px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 18px 40px;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

h1 {
    margin: 0;
    font-size: 32px;
    letter-spacing: -1px;
}

.subtitle {
    margin: 4px 0 0;
    color: var(--secondary);
}

.add-button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.search input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    background: var(--card);
    color: var(--text);
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0 22px;
}

.filter-group {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-group::-webkit-scrollbar {
    display: none;
}

.filter-group button {
    flex: 0 0 auto;
    padding: 8px 13px;
    border: 0;
    border-radius: 100px;
    background: var(--button);
    color: var(--text);
    cursor: pointer;
}

.filter-group button.active {
    background: var(--button-active);
    color: var(--button-active-text);
}

.list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.item {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 15px 16px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--card);
}

.item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.item-info {
    min-width: 0;
    flex: 1;
}

.item-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.item-meta {
    margin-top: 4px;
    color: var(--secondary);
    font-size: 14px;
}

.item-date {
    margin-top: 4px;
    color: var(--secondary);
    font-size: 13px;
    opacity: 0.8;
}

.item.watched .item-title {
    color: var(--secondary);
    text-decoration: line-through;
}

.message {
    padding: 40px 10px;
    text-align: center;
    color: var(--secondary);
}

.error {
    color: #d33;
}

footer {
    display: flex;
    justify-content: space-between;

    margin-top: 24px;
    padding: 15px 4px;

    color: var(--secondary);
    font-size: 14px;
}

footer strong {
    color: var(--text);
}

@media (min-width: 700px) {
    .app {
        padding-top: 48px;
    }

    .filters {
        flex-direction: row;
        justify-content: space-between;
    }
}