/* The shared shell stays fixed; the main region owns page scrolling. */
body {
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    overflow: hidden;
}

.notes-page {
    min-width: 0;
    min-height: 0;
    padding: clamp(1rem, 2.5vw, 2rem);
    line-height: 1.5;
}

.notes-heading,
.notes-actions,
.notes-filter-row,
.notes-search-row,
.notes-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
}

.notes-heading {
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.notes-heading h1 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 650;
}

.notes-actions a {
    padding: .5rem 0;
}

.notes-filters {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: .6rem;
    background: var(--background);
}

.notes-filters label {
    display: grid;
    gap: .25rem;
    min-width: 8rem;
}

.notes-filters input,
.notes-filters select {
    min-width: 0;
    max-width: 100%;
    margin: 0;
}

.notes-search-row {
    align-items: end;
    margin-top: 1rem;
}

.notes-search-row label {
    flex: 1 1 18rem;
}

.notes-page button {
    margin: 0;
}

.notes-status {
    margin: 1rem 0 .5rem;
}

.notes-warning {
    padding: .75rem;
    border-left: .25rem solid var(--focus-color);
    background: var(--background);
}

.notes-workspace {
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) minmax(0, 2fr);
    align-items: start;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.notes-history,
.notes-reader {
    min-width: 0;
}

.notes-list {
    display: grid;
    gap: .5rem;
    padding: 0;
    list-style: none;
}

.notes-record {
    display: grid;
    box-sizing: border-box;
    gap: .35rem;
    width: 100%;
    padding: .8rem;
    text-align: left;
    overflow-wrap: anywhere;
}

.notes-record strong {
    color: inherit;
}

.notes-record span {
    font-size: .85rem;
}

.notes-record[aria-pressed="true"] {
    border-color: var(--focus-color);
    box-shadow: inset .25rem 0 var(--focus-color);
}

.notes-pagination {
    justify-content: space-between;
    margin-top: 1rem;
}

.notes-reader {
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: .6rem;
    background: var(--background);
    overflow-wrap: anywhere;
}

.notes-reader-body {
    margin-top: 1.5rem;
}

.notes-reader-body img,
.notes-reader-body video {
    max-width: 100%;
    height: auto;
}

.notes-reader-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.notes-reader-body pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.notes-report-fields {
    margin: 0;
}

.notes-report-fields > div {
    padding: .75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.notes-report-fields dt {
    font-weight: 650;
}

.notes-report-fields dd {
    margin: .35rem 0 0;
}

.notes-page [hidden] {
    display: none;
}

.notes-page button:focus-visible,
.notes-page a:focus-visible,
.notes-page input:focus-visible,
.notes-page select:focus-visible,
.notes-reader:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 3px;
}

@media (max-width: 64em) {
    .notes-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .notes-reader {
        grid-row: 1;
    }
}
