:root {
    --bg: #fdfdfc;
    --bg-sticky: rgba(253, 253, 252, 0.94);
    --text: #1a1a1a;
    --muted: #6f6f6b;
    --line: #e2e2de;
    --focus: #1a1a1a;
    --error: #a4261b;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141414;
        --bg-sticky: rgba(20, 20, 20, 0.94);
        --text: #ededea;
        --muted: #97978f;
        --line: #2c2c2c;
        --focus: #ededea;
        --error: #e88b80;
    }
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

main {
    max-width: 44rem;
    margin: 0 auto;
    padding: 0 1rem env(safe-area-inset-bottom);
}

/* Paste box */

.paste {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0;
    background: var(--bg-sticky);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}

.paste input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 0 0.75rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.paste input::placeholder {
    color: var(--muted);
}

button {
    min-height: 44px;
    padding: 0 1rem;
    font: inherit;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
}

button:active {
    color: var(--bg);
    background: var(--text);
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* Link list */

.links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.links li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.links a {
    flex: 1;
    min-width: 0;
    padding: 1rem 0;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.links form {
    flex: none;
    margin: 0;
}

.links button {
    color: var(--muted);
    border-color: transparent;
}

.empty,
.error {
    padding: 1rem 0;
    color: var(--muted);
}

.error {
    color: var(--error);
}

/* Login */

.login {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 20rem;
    margin: 20vh auto 0;
}

.login label {
    color: var(--muted);
}

.login input {
    min-height: 44px;
    padding: 0 0.75rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.login .error {
    padding: 0;
}
