:root {
    --admin-forest-950: #071f1c;
    --admin-forest-900: #0c2d27;
    --admin-forest-800: #153e35;
    --admin-forest-700: #235448;
    --admin-cream: #f7f3e8;
    --admin-stone: #ddd7c9;
    --admin-muted: #777970;
    --admin-gold: #c6a659;
    --admin-gold-light: #dfcc8d;
    --admin-error: #9c463f;
    --admin-success: #32755c;
    --admin-serif: Georgia, "Times New Roman", serif;
    --admin-sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --admin-shadow: 0 24px 70px rgb(4 25 21 / 16%);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 0;
    background: var(--admin-cream);
}

body {
    min-width: 0;
    margin: 0;
    background: var(--admin-cream);
    color: #17362f;
    font-family: var(--admin-sans);
    line-height: 1.6;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--admin-gold);
    outline-offset: 3px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

/* Public contact surface */
.messaging-public-page {
    background:
        linear-gradient(180deg, rgb(8 39 33 / 44%), rgb(8 39 33 / 82%)),
        url("../images/meadow-hero-v1.jpg") center / cover fixed;
}

.contact-page-shell {
    display: grid;
    width: min(1180px, calc(100% - 2.5rem));
    min-height: 100svh;
    grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
    align-items: start;
    gap: clamp(2rem, 6vw, 6rem);
    margin: 0 auto;
    padding: clamp(10rem, 16vw, 13rem) 0 6rem;
}

.contact-page-intro {
    position: sticky;
    top: 9rem;
    padding-top: 2rem;
    color: var(--admin-cream);
}

.contact-page-intro h1 {
    max-width: 10ch;
    margin: .5rem 0 1.25rem;
    font-family: var(--admin-serif);
    font-size: clamp(3.5rem, 7vw, 6.7rem);
    font-weight: 400;
    letter-spacing: -.045em;
    line-height: .92;
}

.contact-page-intro > p:last-child {
    max-width: 35rem;
    color: rgb(247 243 232 / 76%);
    font-size: 1.05rem;
}

.contact-form-card {
    padding: clamp(1.5rem, 4vw, 3.5rem);
    border: 1px solid rgb(247 243 232 / 25%);
    border-radius: 1.8rem;
    background: rgb(247 243 232 / 89%);
    box-shadow: 0 34px 100px rgb(3 24 20 / 35%);
    backdrop-filter: blur(24px) saturate(.82);
}

.contact-message-form,
.admin-form,
.admin-panel-form {
    display: grid;
    gap: 1.2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.contact-message-form label,
.admin-form label,
.admin-panel-form label {
    display: grid;
    gap: .45rem;
    color: #26493f;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .045em;
}

.contact-message-form label > span small {
    color: var(--admin-muted);
    font-weight: 500;
}

.contact-message-form input:not([type="checkbox"]),
.contact-message-form select,
.contact-message-form textarea,
.admin-form input,
.admin-panel-form select,
.admin-panel-form textarea,
.inbox-search input {
    width: 100%;
    min-height: 3.15rem;
    padding: .8rem .95rem;
    border: 1px solid rgb(23 62 53 / 20%);
    border-radius: .75rem;
    background: rgb(255 255 255 / 65%);
    color: #153a32;
    font-size: 1rem;
    font-weight: 450;
    letter-spacing: 0;
}

.contact-message-form textarea,
.admin-panel-form textarea {
    min-height: 10rem;
    resize: vertical;
}

.field-guidance,
.admin-field-guidance {
    margin: -.5rem 0 0;
    color: var(--admin-muted);
    font-size: .76rem;
}

.consent-field {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .8rem !important;
    padding: 1rem;
    border: 1px solid rgb(23 62 53 / 13%);
    border-radius: .85rem;
    background: rgb(255 255 255 / 38%);
    font-size: .82rem !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

.consent-field input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: .2rem;
    accent-color: var(--admin-forest-700);
}

.contact-form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-form-actions p {
    max-width: 24rem;
    margin: 0;
    color: var(--admin-muted);
    font-size: .7rem;
}

.contact-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.message-alert,
.message-success,
.admin-error,
.admin-success,
.admin-notice {
    padding: 1rem 1.1rem;
    border-radius: .85rem;
}

.message-alert,
.admin-error {
    border: 1px solid rgb(156 70 63 / 28%);
    background: rgb(156 70 63 / 8%);
    color: #7b302b;
}

.message-success,
.admin-success {
    border: 1px solid rgb(50 117 92 / 28%);
    background: rgb(50 117 92 / 9%);
    color: #225b47;
}

.message-success h2 {
    margin: .4rem 0 .8rem;
    font-family: var(--admin-serif);
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 400;
    line-height: 1;
}

.admin-notice {
    border: 1px solid rgb(198 166 89 / 35%);
    background: rgb(198 166 89 / 12%);
    color: #634f20;
}

.admin-transport-warning {
    display: grid;
    gap: .2rem;
    margin: 0 0 1.2rem;
    padding: .85rem 1rem;
    border: 1px solid rgb(163 77 48 / 38%);
    border-radius: .85rem;
    background: rgb(163 77 48 / 11%);
    color: #74371f;
    font-size: .72rem;
    line-height: 1.45;
}

.admin-transport-warning strong {
    font-size: .66rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.admin-transport-warning-bar {
    position: relative;
    z-index: 45;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .8rem;
    margin: 0;
    border-width: 0 0 1px;
    border-radius: 0;
    padding-inline: clamp(1rem, 4vw, 4rem);
}

/* Practitioner application */
.admin-app-page,
.admin-login-page {
    min-height: 100svh;
}

.admin-login-page {
    display: grid;
    min-height: 100dvh;
    place-items: center;
    padding: 1.25rem;
    background:
        linear-gradient(145deg, rgb(5 29 25 / 76%), rgb(5 29 25 / 96%)),
        url("../images/meadow-hero-v1.jpg") center / cover;
}

.admin-login-shell {
    width: min(100%, 28.5rem);
}

.admin-login-card {
    padding: clamp(1.4rem, 4vw, 2.2rem);
    border: 1px solid rgb(247 243 232 / 18%);
    border-radius: 1.5rem;
    background: rgb(247 243 232 / 94%);
    box-shadow: 0 34px 100px rgb(2 21 18 / 52%);
    backdrop-filter: blur(24px);
}

.admin-login-brand,
.admin-brand {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.admin-login-brand {
    margin-bottom: 1.4rem;
}

.admin-login-brand p {
    margin: 0;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.admin-brand-mark {
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
    border: 2px solid var(--admin-gold);
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgb(198 166 89 / 10%);
}

.admin-eyebrow {
    margin: 0;
    color: #8f7535;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.admin-login-card h1,
.admin-page-heading h1,
.message-detail-heading h1 {
    margin: .35rem 0 1.5rem;
    font-family: var(--admin-serif);
    font-size: clamp(2.6rem, 6vw, 4.8rem);
    font-weight: 400;
    letter-spacing: -.035em;
    line-height: 1;
}

.admin-login-card h1 {
    margin: .25rem 0 1rem;
    font-size: clamp(2.35rem, 7vw, 3.7rem);
}

.admin-form {
    margin-top: 1.4rem;
}

.admin-login-card .admin-form {
    gap: .9rem;
    margin-top: .75rem;
}

.admin-primary-button,
.admin-secondary-button,
.inbox-search button {
    display: inline-flex;
    min-height: 2.8rem;
    align-items: center;
    justify-content: center;
    padding: .7rem 1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-decoration: none;
    text-transform: uppercase;
}

.admin-primary-button {
    background: var(--admin-forest-900);
    color: var(--admin-cream);
}

.admin-primary-button:disabled {
    cursor: wait;
    opacity: .68;
}

.admin-login-card .admin-form.is-submitting input {
    opacity: .72;
}

.admin-secondary-button,
.inbox-search button {
    border-color: rgb(23 62 53 / 20%);
    background: transparent;
    color: var(--admin-forest-900);
}

.admin-security-note {
    margin: 1.5rem 0 0;
    color: var(--admin-muted);
    font-size: .7rem;
}

.admin-login-info-list {
    display: grid;
    gap: .55rem;
    margin-top: 1rem;
}

.admin-login-info {
    overflow: hidden;
    border: 1px solid rgb(23 62 53 / 14%);
    border-radius: .72rem;
    background: rgb(255 255 255 / 30%);
    color: #35584f;
}

.admin-login-info summary {
    display: grid;
    min-height: 2.55rem;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .55rem;
    padding: .55rem .75rem;
    cursor: pointer;
    list-style: none;
}

.admin-login-info summary::-webkit-details-marker {
    display: none;
}

.admin-login-info summary::after {
    width: 1rem;
    color: #789087;
    content: "+";
    font-size: 1rem;
    line-height: 1;
    text-align: center;
}

.admin-login-info[open] summary::after {
    content: "−";
}

.admin-login-info summary span {
    font-size: .63rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.admin-login-info summary small {
    color: var(--admin-muted);
    font-size: .58rem;
}

.admin-login-info p {
    margin: 0;
    padding: .1rem .75rem .75rem;
    color: var(--admin-muted);
    font-size: .66rem;
    line-height: 1.5;
}

.admin-login-transport {
    border-color: rgb(163 77 48 / 28%);
    background: rgb(163 77 48 / 7%);
}

.admin-login-transport summary span {
    color: #74371f;
}

.admin-login-card:has(.admin-form input:focus) .admin-login-info-list {
    display: none;
}

.admin-header {
    position: sticky;
    z-index: 50;
    top: 0;
    display: flex;
    min-height: 5rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem clamp(1rem, 4vw, 4rem);
    border-bottom: 1px solid rgb(247 243 232 / 10%);
    background: rgb(7 31 28 / 92%);
    color: var(--admin-cream);
    backdrop-filter: blur(18px);
}

.admin-brand {
    text-decoration: none;
}

.admin-brand span:last-child {
    display: grid;
}

.admin-brand strong {
    font-family: var(--admin-serif);
    font-size: 1.2rem;
    font-weight: 400;
}

.admin-brand small {
    color: rgb(247 243 232 / 54%);
    font-size: .53rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.admin-header nav {
    display: flex;
    align-items: center;
    gap: clamp(.7rem, 2.5vw, 1.6rem);
}

.admin-header nav a,
.admin-header nav button {
    padding: .45rem 0;
    border: 0;
    background: transparent;
    color: rgb(247 243 232 / 76%);
    cursor: pointer;
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .06em;
    text-decoration: none;
    text-transform: uppercase;
}

.admin-header nav form {
    margin: 0;
}

.admin-main {
    width: min(1180px, calc(100% - 2rem));
    min-height: calc(100svh - 10rem);
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4.5rem) 0;
}

.admin-page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-page-heading h1 {
    margin-bottom: .5rem;
}

.admin-page-heading p:last-child {
    margin: 0;
    color: var(--admin-muted);
}

.inbox-counts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .9rem;
    margin-bottom: 1.25rem;
}

.inbox-counts a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    border: 1px solid rgb(23 62 53 / 12%);
    border-radius: 1rem;
    background: rgb(255 255 255 / 48%);
    text-decoration: none;
}

.inbox-counts span {
    color: var(--admin-muted);
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.inbox-counts strong {
    font-family: var(--admin-serif);
    font-size: 1.8rem;
    font-weight: 400;
}

.inbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.inbox-search {
    display: flex;
    width: min(100%, 39rem);
    gap: .6rem;
}

.inbox-search label {
    flex: 1;
}

.inbox-filters {
    display: flex;
    gap: .3rem;
    padding: .25rem;
    border: 1px solid rgb(23 62 53 / 12%);
    border-radius: 999px;
    background: rgb(255 255 255 / 38%);
}

.inbox-filters a {
    padding: .45rem .75rem;
    border-radius: 999px;
    color: var(--admin-muted);
    font-size: .68rem;
    font-weight: 750;
    text-decoration: none;
    text-transform: uppercase;
}

.inbox-filters a[aria-current="page"] {
    background: var(--admin-forest-900);
    color: var(--admin-cream);
}

.inbox-source-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
    padding: .65rem .8rem;
    border: 1px solid rgb(23 62 53 / 12%);
    border-radius: 1rem;
    background: rgb(247 243 232 / 54%);
}

.inbox-source-filters > span {
    margin-right: .2rem;
    color: var(--admin-muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.inbox-source-filters a,
.message-source {
    display: inline-flex;
    width: fit-content;
    padding: .28rem .58rem;
    border-radius: 999px;
    background: rgb(36 84 72 / 9%);
    color: #2c6555;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-decoration: none;
}

.inbox-source-filters a[aria-current="page"] {
    background: var(--admin-gold);
    color: var(--admin-forest-900);
}

.message-source-therapy {
    background: rgb(172 132 57 / 17%);
    color: #72551e;
}

.message-list {
    overflow: hidden;
    border: 1px solid rgb(23 62 53 / 12%);
    border-radius: 1.2rem;
    background: rgb(255 255 255 / 44%);
    box-shadow: var(--admin-shadow);
}

.message-list-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    padding: 1.2rem;
    border-bottom: 1px solid rgb(23 62 53 / 10%);
    color: inherit;
    text-decoration: none;
    transition: background-color .2s ease;
}

.message-list-item:hover {
    background: rgb(255 255 255 / 66%);
}

.message-list-item:last-child {
    border-bottom: 0;
}

.message-state-dot {
    width: .55rem;
    height: .55rem;
    margin-top: .45rem;
    border: 1px solid #729086;
    border-radius: 50%;
    background: transparent;
}

.message-list-item.is-unread .message-state-dot {
    border-color: var(--admin-gold);
    background: var(--admin-gold);
    box-shadow: 0 0 0 5px rgb(198 166 89 / 10%);
}

.message-list-primary {
    display: grid;
    min-width: 0;
    gap: .28rem;
}

.message-list-primary > span:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .6rem;
}

.message-list-primary strong {
    font-family: var(--admin-serif);
    font-size: 1.25rem;
    font-weight: 400;
}

.message-list-primary small,
.message-preview {
    overflow: hidden;
    color: var(--admin-muted);
    font-size: .76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-topic {
    color: #56766c;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.message-list-meta {
    display: flex;
    align-items: end;
    flex-direction: column;
    gap: .45rem;
}

.message-list-meta time {
    color: var(--admin-muted);
    font-size: .7rem;
}

.status-pill,
.text-star {
    padding: .2rem .45rem;
    border-radius: 999px;
    font-size: .56rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.status-pill {
    background: rgb(36 84 72 / 9%);
    color: #2c6555;
}

.status-closed,
.status-archived {
    background: rgb(101 100 93 / 10%);
    color: #686962;
}

.text-star {
    background: rgb(198 166 89 / 13%);
    color: #806925;
}

.inbox-empty {
    padding: 4rem 2rem;
    text-align: center;
}

.inbox-empty h2 {
    font-family: var(--admin-serif);
    font-size: 2rem;
    font-weight: 400;
}

.admin-back-link {
    display: inline-flex;
    margin-bottom: 1.25rem;
    color: #56766c;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .06em;
    text-decoration: none;
    text-transform: uppercase;
}

.message-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(17rem, .62fr);
    align-items: start;
    gap: 1.25rem;
}

.message-detail-card,
.message-workspace,
.account-card,
.notes-section {
    border: 1px solid rgb(23 62 53 / 12%);
    border-radius: 1.2rem;
    background: rgb(255 255 255 / 50%);
    box-shadow: var(--admin-shadow);
}

.message-detail-card {
    overflow: hidden;
}

.message-detail-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(1.4rem, 4vw, 2.5rem);
    border-bottom: 1px solid rgb(23 62 53 / 10%);
}

.message-detail-heading h1 {
    margin-bottom: 0;
}

.message-detail-date {
    display: grid;
    flex: 0 0 auto;
    gap: .2rem;
    color: var(--admin-muted);
    font-size: .7rem;
    text-align: right;
}

.message-detail-date span {
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.contact-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
    padding: 1.2rem clamp(1.4rem, 4vw, 2.5rem);
    border-bottom: 1px solid rgb(23 62 53 / 10%);
}

.contact-details div {
    min-width: 0;
    padding-right: 1rem;
}

.contact-details dt {
    color: var(--admin-muted);
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.contact-details dd {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .45rem;
    margin: .35rem 0 0;
}

.contact-details dd span {
    overflow-wrap: anywhere;
}

.contact-details button {
    padding: .25rem .4rem;
    border: 1px solid rgb(23 62 53 / 15%);
    border-radius: .4rem;
    background: transparent;
    color: #56766c;
    cursor: pointer;
    font-size: .58rem;
    font-weight: 750;
    text-transform: uppercase;
}

.stored-message {
    padding: clamp(1.4rem, 4vw, 2.5rem);
}

.stored-message h2,
.admin-panel-form h2,
.notes-heading h2 {
    margin: 0 0 1rem;
    font-family: var(--admin-serif);
    font-size: 1.7rem;
    font-weight: 400;
}

.stored-message p {
    margin: 0;
    font-family: var(--admin-serif);
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    line-height: 1.75;
}

.message-workspace {
    display: grid;
    gap: 0;
    overflow: hidden;
}

.admin-panel-form {
    padding: 1.2rem;
    border-bottom: 1px solid rgb(23 62 53 / 10%);
}

.admin-panel-form:last-child {
    border-bottom: 0;
}

.admin-checkbox {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: .6rem !important;
}

.admin-checkbox input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--admin-forest-700);
}

.notes-section {
    margin-top: 1.25rem;
    padding: 1.3rem;
}

.notes-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notes-heading span {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 50%;
    background: rgb(36 84 72 / 9%);
    font-size: .72rem;
}

.notes-list {
    display: grid;
    gap: .8rem;
}

.notes-list article {
    padding: 1rem;
    border: 1px solid rgb(23 62 53 / 10%);
    border-radius: .8rem;
    background: rgb(255 255 255 / 35%);
}

.notes-list header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--admin-muted);
    font-size: .68rem;
}

.notes-list p {
    margin: .7rem 0 0;
}

.notes-empty {
    color: var(--admin-muted);
}

.admin-account-main {
    max-width: 760px;
}

/* News collection manager */
.admin-news-main {
    width: min(1260px, calc(100% - 2rem));
}

.admin-news-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(17rem, .58fr);
    align-items: start;
    gap: 1.25rem;
}

.admin-news-form,
.admin-news-recent {
    border: 1px solid rgb(23 62 53 / 12%);
    border-radius: 1.2rem;
    background: rgb(255 255 255 / 50%);
    box-shadow: var(--admin-shadow);
}

.admin-news-form {
    display: grid;
    gap: 1.35rem;
    margin: 0;
    padding: clamp(1.25rem, 3vw, 2rem);
}

.admin-news-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.admin-news-url,
.admin-news-title,
.admin-news-summary {
    grid-column: 1 / -1;
}

.admin-news-form label,
.admin-tag-fieldset legend {
    color: var(--admin-forest-900);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.admin-news-form label {
    display: grid;
    gap: .38rem;
}

.admin-news-form input,
.admin-news-form select,
.admin-news-form textarea {
    width: 100%;
    border: 1px solid rgb(23 62 53 / 18%);
    border-radius: .72rem;
    background: rgb(255 255 255 / 62%);
    color: var(--admin-forest-900);
}

.admin-news-form input,
.admin-news-form select {
    min-height: 3rem;
    padding: .68rem .82rem;
}

.admin-news-form textarea {
    min-height: 7.5rem;
    padding: .8rem;
    resize: vertical;
}

.admin-news-form label small {
    color: var(--admin-muted);
    font-size: .65rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.admin-tag-fieldset {
    min-width: 0;
    margin: 0;
    padding: 1rem;
    border: 1px solid rgb(23 62 53 / 12%);
    border-radius: .9rem;
}

.admin-tag-fieldset > p {
    margin: .2rem 0 .75rem;
    color: var(--admin-muted);
    font-size: .7rem;
}

.admin-tag-picker {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.admin-tag-picker label {
    display: inline-flex;
    cursor: pointer;
}

.admin-tag-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.admin-tag-picker span {
    display: inline-flex;
    min-height: 2.25rem;
    align-items: center;
    padding: .42rem .72rem;
    border: 1px solid rgb(23 62 53 / 18%);
    border-radius: 999px;
    background: rgb(247 243 232 / 72%);
    color: #4f6c63;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: none;
    transition: .18s ease;
}

.admin-tag-picker input:checked + span {
    border-color: var(--admin-gold);
    background: var(--admin-gold);
    color: var(--admin-forest-900);
}

.admin-tag-picker input:focus-visible + span {
    outline: 3px solid var(--admin-gold);
    outline-offset: 3px;
}

.admin-news-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-news-actions span {
    max-width: 31rem;
    color: var(--admin-muted);
    font-size: .66rem;
}

.admin-news-recent {
    position: sticky;
    top: 6.25rem;
    padding: 1.25rem;
}

.admin-news-recent h2 {
    margin: .25rem 0 .35rem;
    font-family: var(--admin-serif);
    font-size: 1.8rem;
    font-weight: 400;
}

.admin-news-recent > p:not(.admin-eyebrow) {
    margin: 0 0 1rem;
    color: var(--admin-muted);
    font-size: .72rem;
}

.admin-news-recent > div {
    display: grid;
}

.admin-news-recent article {
    display: grid;
    gap: .25rem;
    padding: .85rem 0;
    border-top: 1px solid rgb(23 62 53 / 10%);
}

.admin-news-recent article span {
    color: #8f7535;
    font-size: .59rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.admin-news-recent article a {
    font-family: var(--admin-serif);
    font-size: 1rem;
    line-height: 1.35;
    text-decoration-color: rgb(23 62 53 / 24%);
}

/* Library CMS */
.admin-library-main {
    width: min(1320px, calc(100% - 2rem));
}

.admin-heading-actions,
.library-editor-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.library-cms-counts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1.25rem;
}

.library-cms-counts > div {
    display: flex;
    min-height: 5rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    border: 1px solid rgb(23 62 53 / 12%);
    border-radius: 1rem;
    background: rgb(255 255 255 / 46%);
}

.library-cms-counts span {
    color: var(--admin-muted);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.library-cms-counts strong {
    font-family: var(--admin-serif);
    font-size: 1.9rem;
    font-weight: 400;
}

.library-cms-panel {
    overflow: hidden;
    border: 1px solid rgb(23 62 53 / 12%);
    border-radius: 1.2rem;
    background: rgb(255 255 255 / 46%);
    box-shadow: var(--admin-shadow);
}

.library-cms-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem;
    border-bottom: 1px solid rgb(23 62 53 / 10%);
}

.library-cms-toolbar h2 {
    margin: .25rem 0 0;
    font-family: var(--admin-serif);
    font-size: 1.8rem;
    font-weight: 400;
}

.library-cms-search {
    width: min(100%, 29rem);
}

.library-cms-search input {
    width: 100%;
    min-height: 2.8rem;
    padding: .65rem .85rem;
    border: 1px solid rgb(23 62 53 / 16%);
    border-radius: 999px;
    background: rgb(255 255 255 / 62%);
}

.library-cms-results {
    margin: 0;
    padding: .65rem 1.25rem;
    border-bottom: 1px solid rgb(23 62 53 / 8%);
    color: var(--admin-muted);
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.library-cms-list {
    display: grid;
}

.library-cms-row {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgb(23 62 53 / 9%);
}

.library-cms-row:last-child {
    border-bottom: 0;
}

.library-cms-row[hidden] {
    display: none;
}

.library-cms-file-mark {
    display: grid;
    width: 3.6rem;
    min-height: 4.2rem;
    place-items: end center;
    padding: .5rem .25rem;
    border: 1px solid rgb(23 62 53 / 16%);
    border-radius: .4rem .9rem .4rem .4rem;
    background:
        linear-gradient(145deg, transparent 19%, rgb(198 166 89 / 14%) 20%),
        rgb(247 243 232 / 74%);
    color: #7c672f;
    font-size: .56rem;
    font-weight: 850;
    letter-spacing: .05em;
}

.library-cms-row-copy {
    min-width: 0;
}

.library-cms-row-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .55rem;
}

.library-cms-row h3 {
    margin: 0;
    font-family: var(--admin-serif);
    font-size: 1.22rem;
    font-weight: 400;
    line-height: 1.3;
}

.library-cms-row-copy > p {
    display: -webkit-box;
    overflow: hidden;
    margin: .32rem 0 .55rem;
    color: var(--admin-muted);
    font-size: .72rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.library-cms-featured,
.library-cms-row-tags span {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    font-size: .57rem;
    font-weight: 800;
    letter-spacing: .035em;
}

.library-cms-featured {
    padding: .18rem .45rem;
    background: rgb(198 166 89 / 18%);
    color: #775f23;
    text-transform: uppercase;
}

.library-cms-row-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.library-cms-row-tags span {
    padding: .2rem .45rem;
    background: rgb(36 84 72 / 8%);
    color: #476d61;
}

.library-cms-row-actions {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.library-cms-row-actions > a:first-child {
    color: var(--admin-muted);
    font-size: .66rem;
    font-weight: 750;
    text-decoration-color: rgb(23 62 53 / 24%);
    text-transform: uppercase;
}

.library-cms-empty {
    padding: 4rem 2rem;
    text-align: center;
}

.library-cms-empty h3 {
    margin: 0;
    font-family: var(--admin-serif);
    font-size: 1.8rem;
    font-weight: 400;
}

.library-cms-empty p {
    margin: .45rem 0 0;
    color: var(--admin-muted);
}

.admin-library-editor-main {
    width: min(1240px, calc(100% - 2rem));
}

.library-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(18rem, .55fr);
    align-items: start;
    gap: 1.25rem;
}

.library-editor-form,
.library-editor-sidebar section {
    border: 1px solid rgb(23 62 53 / 12%);
    border-radius: 1.2rem;
    background: rgb(255 255 255 / 50%);
    box-shadow: var(--admin-shadow);
}

.library-editor-form {
    display: grid;
    gap: 0;
    margin: 0;
}

.library-editor-section {
    min-width: 0;
    margin: 0;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 0;
    border-bottom: 1px solid rgb(23 62 53 / 10%);
}

.library-editor-section > legend {
    float: left;
    width: 100%;
    margin: 0 0 1.1rem;
    color: #8f7535;
    font-size: .66rem;
    font-weight: 850;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.library-editor-fields {
    display: grid;
    clear: both;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.library-editor-form label,
.library-editor-danger label {
    display: grid;
    gap: .38rem;
    color: var(--admin-forest-900);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.library-editor-form input,
.library-editor-form textarea,
.library-editor-danger input {
    width: 100%;
    border: 1px solid rgb(23 62 53 / 18%);
    border-radius: .72rem;
    background: rgb(255 255 255 / 66%);
    color: var(--admin-forest-900);
}

.library-editor-form input,
.library-editor-danger input {
    min-height: 3rem;
    padding: .68rem .82rem;
}

.library-editor-form textarea {
    min-height: 8rem;
    padding: .82rem;
    resize: vertical;
}

.library-editor-wide {
    grid-column: 1 / -1;
}

.library-editor-form label small {
    color: var(--admin-muted);
    font-size: .63rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.library-editor-featured {
    display: flex !important;
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding: .9rem;
    border: 1px solid rgb(23 62 53 / 12%);
    border-radius: .8rem;
    background: rgb(247 243 232 / 55%);
    cursor: pointer;
}

.library-editor-featured input {
    width: 1.15rem;
    min-height: 1.15rem;
    margin-top: .15rem;
    accent-color: var(--admin-gold);
}

.library-editor-featured > span {
    display: grid;
    gap: .15rem;
}

.library-editor-featured small {
    color: var(--admin-muted);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.library-upload-field {
    display: grid;
    clear: both;
    gap: .5rem;
}

.library-upload-field input[type="file"] {
    padding: .45rem;
}

.library-upload-field input::file-selector-button {
    margin-right: .75rem;
    padding: .55rem .72rem;
    border: 0;
    border-radius: .5rem;
    background: var(--admin-forest-900);
    color: var(--admin-cream);
    cursor: pointer;
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
}

.library-upload-field p {
    margin: 0;
    color: var(--admin-muted);
    font-size: .66rem;
}

.library-editor-actions {
    padding: 1.25rem clamp(1.25rem, 3vw, 2rem);
}

.library-editor-sidebar {
    display: grid;
    gap: 1rem;
}

.library-editor-sidebar section {
    padding: 1.25rem;
}

.library-editor-sidebar h2 {
    overflow-wrap: anywhere;
    margin: .25rem 0 1rem;
    font-family: var(--admin-serif);
    font-size: 1.45rem;
    font-weight: 400;
    line-height: 1.25;
}

.library-editor-sidebar > section > p:not(.admin-eyebrow) {
    margin: 0;
    color: var(--admin-muted);
    font-size: .72rem;
}

.library-editor-sidebar dl {
    display: grid;
    gap: .65rem;
    margin: 0;
}

.library-editor-sidebar dl div {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    gap: .7rem;
    padding-top: .65rem;
    border-top: 1px solid rgb(23 62 53 / 10%);
}

.library-editor-sidebar dt {
    color: var(--admin-muted);
    font-size: .59rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.library-editor-sidebar dd {
    overflow-wrap: anywhere;
    margin: 0;
    font-size: .7rem;
}

.library-editor-danger {
    border-color: rgb(156 70 63 / 22%) !important;
    background: rgb(156 70 63 / 4%) !important;
}

.library-editor-danger form {
    display: grid;
    gap: .8rem;
    margin-top: 1rem;
}

.library-delete-button {
    min-height: 2.7rem;
    padding: .65rem .8rem;
    border: 1px solid #9c463f;
    border-radius: 999px;
    background: transparent;
    color: #7b302b;
    cursor: pointer;
    font-size: .66rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.account-card {
    padding: clamp(1.3rem, 4vw, 2.5rem);
}

.admin-footer {
    padding: 1.5rem;
    border-top: 1px solid rgb(23 62 53 / 10%);
    color: var(--admin-muted);
    font-size: .65rem;
    text-align: center;
}

@media (max-width: 880px) {
    .contact-page-shell,
    .message-detail-layout,
    .admin-news-layout,
    .library-editor-layout {
        grid-template-columns: 1fr;
    }

    .admin-news-recent {
        position: static;
    }

    .contact-page-intro {
        position: static;
        padding-top: 0;
    }

    .contact-page-intro h1 {
        max-width: 12ch;
    }

    .inbox-counts {
        grid-template-columns: 1fr 1fr;
    }

    .inbox-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .inbox-search {
        width: 100%;
    }

    .library-cms-counts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .library-cms-row {
        grid-template-columns: 3.5rem minmax(0, 1fr);
    }

    .library-cms-row-actions {
        grid-column: 2;
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .admin-login-page {
        place-items: start center;
        padding: .65rem;
    }

    .admin-login-shell {
        width: min(100%, 27rem);
    }

    .admin-login-card {
        padding: 1.15rem;
        border-radius: 1rem;
    }

    .admin-login-brand {
        gap: .65rem;
        margin-bottom: .8rem;
    }

    .admin-login-brand p {
        font-size: .6rem;
        letter-spacing: .065em;
    }

    .admin-login-card .admin-eyebrow {
        font-size: .56rem;
    }

    .admin-login-card h1 {
        margin: .16rem 0 .72rem;
        font-size: clamp(2rem, 11vw, 2.7rem);
    }

    .admin-login-card .admin-form {
        gap: .68rem;
        margin-top: .45rem;
    }

    .admin-login-card .admin-form label {
        gap: .25rem;
        font-size: .7rem;
    }

    .admin-login-card .admin-form input {
        min-height: 2.8rem;
        padding: .62rem .78rem;
        border-radius: .65rem;
    }

    .admin-login-card .admin-primary-button {
        min-height: 2.7rem;
        padding-block: .58rem;
    }

    .admin-login-info-list {
        gap: .42rem;
        margin-top: .72rem;
    }

    .admin-login-info summary {
        min-height: 2.35rem;
        padding: .45rem .65rem;
    }

    .admin-login-info p {
        padding: .05rem .65rem .65rem;
    }

    .contact-page-shell {
        width: min(100% - 1.25rem, 40rem);
        padding-top: 8rem;
    }

    .form-grid,
    .contact-details,
    .admin-news-fields,
    .library-editor-fields {
        grid-template-columns: 1fr;
    }

    .admin-news-url,
    .admin-news-title,
    .admin-news-summary {
        grid-column: auto;
    }

    .contact-form-actions,
    .admin-page-heading,
    .message-detail-heading,
    .admin-news-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .contact-form-actions {
        display: grid;
    }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-header nav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .admin-heading-actions,
    .library-editor-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .library-cms-counts {
        grid-template-columns: 1fr 1fr;
    }

    .library-cms-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .library-cms-search {
        width: 100%;
    }

    .library-cms-row {
        grid-template-columns: 1fr;
    }

    .library-cms-file-mark {
        width: 3.2rem;
        min-height: 3.65rem;
    }

    .library-cms-row-actions {
        grid-column: auto;
        flex-wrap: wrap;
    }

    .library-editor-wide,
    .library-editor-featured {
        grid-column: auto;
    }

    .inbox-counts {
        grid-template-columns: 1fr 1fr;
    }

    .inbox-search {
        display: grid;
    }

    .message-list-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .message-list-meta {
        grid-column: 2;
        align-items: start;
        flex-flow: row wrap;
    }

    .message-preview {
        white-space: normal;
    }

    .message-detail-date {
        text-align: left;
    }

    .contact-details {
        gap: 1rem;
    }
}

@media (max-height: 700px) {
    .admin-login-page {
        place-items: start center;
        padding-block: .5rem;
    }

    .admin-login-card {
        padding-block: 1rem;
    }

    .admin-login-brand {
        margin-bottom: .65rem;
    }

    .admin-login-card h1 {
        margin-bottom: .6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
