:root {
    color-scheme: light;
    --ink: #202020;
    --muted: #606060;
    --line: #cecece;
    --paper: #fff;
    --wash: #f4f4f4;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-size: 16px;
    line-height: 1.5
}

* {
    box-sizing: border-box
}

body {
    margin: 0
}

a {
    color: inherit;
    text-underline-offset: .22em
}

button,
input,
select,
textarea {
    font: inherit
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 44px;
    padding: .6rem 1.1rem;
    border: 1px solid #777;
    border-radius: 3px;
    background: #fff;
    color: var(--ink);
    font-weight: 550;
    text-decoration: none;
    cursor: pointer
}

button:hover,
.button:hover {
    background: #ededed
}

button.primary {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink)
}

button.primary:hover {
    background: #414141
}

a:hover {
    text-decoration-thickness: 2px
}

:focus-visible {
    outline: 3px solid #111;
    outline-offset: 4px
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: .7rem .8rem;
    border: 1px solid #888;
    border-radius: 3px;
    color: var(--ink);
    background: #fff
}

textarea {
    resize: vertical;
    line-height: 1.65
}

input::placeholder,
textarea::placeholder {
    color: #707070;
    opacity: 1
}

input[type=checkbox] {
    width: 18px;
    min-height: 18px;
    height: 18px;
    accent-color: #222;
    flex-shrink: 0
}

h1,
h2,
h3,
p {
    margin: 0
}

h1,
h2,
h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400
}

h1 {
    font-size: clamp(2.6rem, 6vw, 3.8rem);
    line-height: 1.12;
    letter-spacing: -.045em
}

h2 {
    font-size: 1.7rem;
    line-height: 1.25
}

h3 {
    font-size: 1.45rem;
    line-height: 1.3;
    overflow-wrap: anywhere
}

label {
    font-size: .94rem;
    font-weight: 550
}

.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 40px
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 100px;
    border-bottom: 1px solid var(--ink)
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.4rem;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: -.04em
}

.text-button {
    background: transparent;
    border-color: transparent;
    padding: .5rem;
    font-size: .9rem;
    font-weight: 400
}

.private-label {
    font-size: .85rem;
    color: var(--muted)
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin: 42px 0 30px
}

.eyebrow {
    font-size: .75rem;
    letter-spacing: .14em;
    font-weight: 650;
    margin-bottom: 12px
}

.library-total {
    font-size: .9rem;
    color: var(--muted);
    padding-bottom: .4rem
}

.heading-dot {
    color: #777
}

.add-panel {
    padding: 26px 28px;
    background: var(--wash);
    border: 1px solid var(--line);
    border-top: 3px solid var(--ink)
}

.add-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 16px
}

.quick-input {
    font-size: 1.08rem;
    min-height: 54px
}

.hint {
    font-size: .875rem;
    color: var(--muted);
    font-weight: 400
}

.add-panel .hint {
    margin-top: 8px
}

.add-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px
}

.add-actions button {
    min-width: 126px
}

.find-panel {
    margin-top: 30px
}

.find-panel label[for=search] {
    display: block;
    margin-bottom: 8px
}

.search-row {
    display: flex;
    gap: 10px
}

.search-row input {
    flex: 1
}

.search-row button {
    min-width: 96px
}

.tag-filters {
    border: 0;
    padding: 0;
    margin: 18px 0 0;
    min-width: 0
}

.tag-filters legend {
    padding: 0;
    font-size: .875rem;
    font-weight: 550
}

.tag-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0
}

.tag-option {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 6px 10px;
    font-weight: 400;
    cursor: pointer;
    overflow-wrap: anywhere;
    max-width: 100%
}

.tag-count {
    color: var(--muted);
    font-size: .8rem;
    margin-left: 5px
}

.small-button {
    font-size: .875rem;
    padding: .4rem .8rem
}

.filter-summary {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    font-size: .875rem;
    margin-top: 16px
}

.shelf-nav {
    display: flex;
    gap: 28px;
    border-bottom: 1px solid var(--line);
    margin-top: 34px;
    padding: 0 0 14px
}

.shelf-nav a {
    font-size: .9rem;
    text-decoration: none;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px
}

.shelf-nav a[aria-current="page"] {
    font-weight: 700;
    box-shadow: 0 2px 0 currentColor
}

.shelf-nav span {
    font-size: .8rem;
    background: #eee;
    min-width: 22px;
    text-align: center;
    padding: 1px 5px
}

.shelf {
    scroll-margin-top: 24px;
    margin-top: 30px
}

.shelf-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px
}

.shelf-heading h2 {
    display: flex;
    align-items: center;
    gap: 12px
}

.shelf-count {
    font: 400 .85rem system-ui, sans-serif;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 50%;
    min-width: 25px;
    height: 25px;
    text-align: center;
    line-height: 23px
}

.sort-label {
    font-size: .8rem;
    color: var(--muted)
}

.book-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line)
}

.book-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 23px 0;
    border-bottom: 1px solid var(--line)
}

.book-content {
    min-width: 0;
    flex: 1
}

.book-content h3 a {
    text-decoration: none
}

.author {
    margin-top: 5px;
    color: #505050;
    font-size: .95rem;
    overflow-wrap: anywhere
}

.finished {
    font-size: .8rem;
    color: var(--muted);
    margin-top: 10px
}

.book-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    flex-shrink: 0
}

.status-buttons {
    display: flex;
    gap: 0
}

.status-buttons button {
    border-radius: 0;
    min-height: 44px;
    font-size: .8rem;
    padding: .45rem .65rem;
    font-weight: 400
}

.status-buttons button+button {
    margin-left: -1px
}

.status-buttons button:first-of-type {
    border-radius: 3px 0 0 3px
}

.status-buttons button:last-child {
    border-radius: 0 3px 3px 0
}

.status-buttons .selected {
    background: #252525;
    color: #fff;
    border-color: #252525;
    font-weight: 600;
    position: relative
}

.edit-link {
    font-size: .8rem;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 7px
}

.book-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 12px 0 0
}

.book-tags a {
    display: block;
    font-size: .8rem;
    border: 1px solid var(--line);
    padding: 4px 9px;
    text-decoration: none;
    background: #f7f7f7;
    overflow-wrap: anywhere
}

.notes {
    font-size: .875rem;
    margin-top: 12px
}

.notes summary {
    cursor: pointer;
    min-height: 32px;
    padding: 4px 0
}

.notes p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.75;
    border-left: 2px solid var(--line);
    padding: 8px 14px;
    margin-top: 6px
}

.empty-shelf {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 24px 0;
    color: var(--muted);
    font-size: .9rem
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 64px;
    padding: 22px 0 30px;
    border-top: 1px solid var(--ink);
    font-size: .8rem;
    color: var(--muted)
}

.site-footer span:first-child {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    color: var(--ink)
}

.notice,
.error {
    border: 1px solid #777;
    border-left: 4px solid #222;
    padding: 14px 18px;
    font-size: .94rem;
    margin: 20px 0;
    background: var(--wash)
}

.error {
    font-weight: 550
}

.login-panel {
    max-width: 480px;
    margin: 72px auto 88px
}

.login-panel h1 {
    font-size: 2.9rem
}

.login-panel p:not(.eyebrow) {
    margin-top: 20px
}

.intro {
    color: var(--muted)
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.login-panel .stack {
    margin-top: 32px
}

.login-panel .stack label:not(:first-of-type) {
    margin-top: 12px
}

.login-panel button {
    margin-top: 16px
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    font-size: .9rem;
    min-height: 32px
}

.back-link+.page-heading {
    margin-top: 14px
}

.edit-form {
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 22px
}

.form-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 8px
}

.form-actions a {
    padding: 10px 0;
    font-size: .94rem
}

.delete-area {
    max-width: 760px;
    border-top: 1px solid var(--line);
    padding-top: 24px;
    margin-top: 40px;
    font-size: .875rem
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    transform: translateY(-150%);
    background: #fff;
    padding: 12px;
    z-index: 10
}

.skip-link:focus {
    transform: none
}

@media(max-width:640px) {
    .page {
        padding: 0 20px
    }

    .site-header {
        min-height: 78px
    }

    .brand {
        font-size: 1.2rem
    }

    .private-label {
        display: none
    }

    .page-heading {
        display: block;
        margin: 28px 0 24px
    }

    .library-total {
        margin-top: 12px
    }

    .add-panel {
        padding: 20px 16px
    }

    .add-actions {
        gap: 8px
    }

    .add-actions button {
        flex: 1;
        min-width: 0;
        padding: .6rem .5rem;
        white-space: nowrap;
        font-size: .9rem
    }

    .shelf-nav {
        gap: 22px
    }

    .shelf-heading {
        align-items: flex-start
    }

    .sort-label {
        max-width: 95px;
        text-align: right;
        line-height: 1.4
    }

    .book-row {
        flex-direction: column;
        gap: 16px;
        padding: 20px 0
    }

    .book-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px
    }

    .status-buttons button {
        font-size: .85rem;
        padding: .5rem .75rem
    }

    .edit-link {
        min-height: 44px;
        white-space: nowrap
    }

    .form-columns {
        grid-template-columns: 1fr;
        gap: 20px
    }

    .login-panel {
        margin: 48px auto 64px
    }

    .login-panel h1 {
        font-size: 2.5rem
    }

    .shelf-heading h2 {
        font-size: 1.55rem
    }

    .shelf-heading h2 {
        gap: 9px
    }

    .site-footer {
        margin-top: 44px
    }
}

@media(max-width:360px) {
    .page {
        padding: 0 14px
    }

    .book-controls {
        flex-wrap: wrap
    }

    .shelf-nav {
        gap: 16px
    }

    .add-actions button {
        font-size: .8rem
    }

    .tag-filters legend .hint {
        display: block
    }
}

@media print {

    .site-header form,
    .add-panel,
    .find-panel,
    .shelf-nav,
    .book-controls,
    .site-footer,
    .notice {
        display: none
    }

    .page {
        max-width: none;
        padding: 0
    }

    .book-row {
        break-inside: avoid
    }

    .notes {
        display: block
    }

    a {
        text-decoration: none
    }
}
