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

.skip-link:focus { transform: none; }
.top nav { gap: .2rem 1.25rem; }
.top nav > a { padding: .65rem 0 .55rem; border-bottom: 2px solid transparent; }
.top nav > a[aria-current] { color: #215834; border-color: #397751; }
.site-tools { position: relative; }
.site-tools summary { cursor: pointer; color: var(--ink); padding: .55rem 0; }
.site-tools div {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 5;
    display: grid;
    min-width: max-content;
    padding: .25rem .8rem;
    border: 1px solid var(--line);
    background: #fff;
}
.site-tools div a { padding: .45rem 0; }
.site-tools:not([open]) div { display: none; }

.foot { align-items: center; flex-wrap: wrap; gap: .6rem 1.4rem; }
.foot-account, .foot-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem 1rem; }
.foot-meta { margin-left: auto; }

.admin-workspace {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: start;
    gap: clamp(1rem, 4vw, 2.8rem);
}
.admin-workspace h1 { font-size: clamp(1.7rem, 3vw, 2.45rem); margin: 0 0 .9rem; }
.admin-menu { border-right: 1px solid var(--line); padding-right: .9rem; }
.admin-menu section + section { margin-top: 1.15rem; }
.admin-menu h2 {
    margin: 0 0 .25rem;
    font-size: .83rem;
    font-weight: 650;
    color: var(--muted);
    letter-spacing: 0;
}
.admin-menu a {
    display: block;
    padding: .43rem .55rem;
    color: var(--ink);
    text-decoration: none;
    border-left: 2px solid transparent;
}
.admin-menu a:hover { background: #f0f4f0; text-decoration: underline; }
.admin-menu a[aria-current] {
    border-color: #397751;
    background: #edf5ef;
    color: #215834;
    font-weight: 700;
}
.admin-workspace .card {
    padding: clamp(.9rem, 2vw, 1.35rem);
    border-radius: 7px;
    box-shadow: none;
}
.admin-workspace .card h2:first-child { margin-top: 0; }
.admin-workspace .button:not(.secondary), .admin-workspace button:not(.secondary) {
    background: #246039;
    color: #fff;
}
.admin-summary { display: flex; align-items: baseline; justify-content: space-between; gap: .7rem 1.3rem; flex-wrap: wrap; }
.admin-summary h2, .admin-summary p { margin: 0; }
.admin-summary + * { margin-top: .9rem; }
.admin-filters {
    display: grid;
    grid-template-columns: minmax(130px, 1.5fr) minmax(105px, 1fr) minmax(110px, 1fr) auto;
    align-items: start;
    gap: .75rem;
    padding: .8rem 0 1rem;
    border-bottom: 1px solid var(--line);
}
.admin-filters button { align-self: end; margin-bottom: .32rem; }
.ledger-filters { grid-template-columns: repeat(4, minmax(115px, 1fr)) auto; }
.admin-table { min-width: 530px; }
.admin-table td:first-child { white-space: nowrap; }
.admin-table .event-name { font-weight: 700; }
.admin-table small { display: block; }
.admin-pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .8rem; margin-top: .8rem; }
.admin-event-actions { margin: 0 0 1rem; }
.admin-event-actions form { align-self: center; }
.admin-event-actions a { display: inline-block; padding: .4rem .2rem; }
.admin-workspace .field > details, .admin-workspace details { border-top: 1px solid var(--line); padding: .55rem 0; }
.admin-workspace summary { cursor: pointer; font-weight: 650; }
.admin-workspace details[open] summary { margin-bottom: .7rem; }

.editor-back { margin: 0 0 .4rem; }
.editor-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1rem; }
.editor-heading h1, .editor-heading p { margin: 0; }
.editor-operations { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; margin: .65rem 0; }
.editor-operations a { padding: .2rem 0; }
.editor-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0 .35rem;
    margin: 1rem 0 .8rem;
    border-bottom: 1px solid var(--line);
}
.editor-tabs a {
    display: block;
    padding: .58rem .72rem;
    color: var(--ink);
    font-weight: 650;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}
.editor-tabs a:hover { background: #f0f4f0; }
.editor-tabs a[aria-selected="true"] { border-color: #397751; color: #215834; }
.event-editor [hidden] { display: none !important; }
.editor-panel h2 { font-size: 1.06rem; }
.editor-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem 1rem;
    align-items: start;
}
.editor-span-two { grid-column: span 2; }
.editor-field { min-width: 0; }
.editor-field > label {
    display: grid;
    justify-items: start;
    gap: .18rem;
}
.editor-field input[type="datetime-local"] { max-width: 17rem; }
.editor-field input[type="number"] { max-width: 13rem; }
.editor-field textarea { min-height: 6rem; resize: vertical; }
.editor-field small { display: block; margin-top: .2rem; }
.editor-panel .editor-divider { border-top: 1px solid var(--line); padding-top: .85rem; margin-top: 1.05rem; }
.editor-checks { display: grid; gap: .35rem; min-height: 100%; align-content: end; }
.editor-current-image { width: auto; max-width: min(100%, 160px); max-height: 100px; object-fit: contain; }
.editor-save {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    padding: .7rem 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
}
.editor-field-error { margin: .25rem 0 0; color: #91241b; font-size: .9rem; }
.event-editor [aria-invalid="true"] { border-color: #a32920; }
.event-editor .editor-error { margin: .6rem 0; }

.staff-view .wrap { max-width: 1920px; }
.staff-view input:not([type="checkbox"]):not([type="radio"]),
.staff-view select,
.staff-view textarea { padding: .35rem .48rem; }
.staff-view .button,
.staff-view button { padding: .4rem .65rem; }
.staff-view [data-clickable-row] { cursor: pointer; }
.staff-view tr[data-clickable-row]:hover,
.staff-view li[data-clickable-row]:hover { background: #edf5ef; }
.record-table td { vertical-align: top; }
.directory-actions { display:flex; gap: .75rem 1.2rem; flex-wrap:wrap; align-items:flex-start; margin-bottom:1rem; }
.directory-actions .record-picker { flex: 1 1 18rem; }
.directory-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(13rem,100%),1fr)); gap:.45rem .8rem; align-items:start; }
.directory-editor form { max-width:56rem; }
.directory-editor fieldset { border:1px solid var(--line); border-radius:.35rem; padding:.55rem .7rem; margin:.6rem 0; }
.public-events .event-row { position: relative; }
.public-events .event-row:hover { background: #edf5ef; }
.public-events .event-main h3 a::after { content: ""; position: absolute; inset: 0; }
.public-events a.event-action { position: relative; z-index: 1; }
.public-events a.event-action:focus-visible::after { outline: 2px solid #397751; }
.staff-view .staff-icon-action {
    display: inline-grid;
    width: 2.2rem;
    min-width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    padding: 0;
}
.staff-icon-action svg { width: 1.18rem; height: 1.18rem; }
.staff-icon-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ledger-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}
.ledger-filter-grid label { min-width: 0; }

@media (max-width: 980px) {
    .editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .editor-span-two { grid-column: auto; }
}

@media (max-width: 750px) {
    .admin-workspace { grid-template-columns: minmax(0, 1fr); }
    .admin-menu {
        display: flex;
        flex-wrap: wrap;
        align-items: start;
        gap: .6rem 1.2rem;
        padding: 0 0 .8rem;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .admin-menu section + section { margin: 0; }
    .admin-filters { grid-template-columns: 1fr 1fr; }
    .top nav { column-gap: .8rem; }
}

@media (max-width: 420px) {
    .admin-filters { grid-template-columns: 1fr; }
    .admin-filters button { justify-self: start; }
    .foot-meta { margin-left: 0; }
    .catalog-table { min-width: 0; }
    .catalog-table tbody, .catalog-table tr, .catalog-table td { display: block; }
    .catalog-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
    .catalog-table tr { padding: .5rem 0; border-bottom: 1px solid var(--line); }
    .catalog-table td { padding: .12rem .2rem; border-bottom: 0; }
}

@media (max-width: 500px) {
    .editor-grid { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
    .editor-tabs a { padding: .45rem .55rem; }
    .editor-save { justify-content: stretch; }
    .editor-save button { width: 100%; }
}

@media print {
    .admin-menu, .admin-filters, .admin-pagination, .admin-event-actions { display: none; }
    .editor-tabs, .editor-operations, .editor-save { display: none; }
    .admin-workspace { display: block; }
}
