@font-face {
    font-family: "MP Sans";
    src: url("SourceSans3-Regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "MP Sans";
    src: url("SourceSans3-Semibold.woff2") format("woff2");
    font-weight: 600 900;
    font-display: swap;
}

@font-face {
    font-family: "MP Serif";
    src: url("SourceSerif4-Regular.woff2") format("woff2");
    font-display: swap;
}

html:root {
    --gutter: 0px;
    --wrap: 1040px;
    --paper: #f7f7f1;
    --surface: #fff;
    --soft: #edf1f4;
    --ink: #293b4c;
    --heading: #112d48;
    --muted: #516375;
    --gold: #8d6c27;
    --accent: #112d48;
    --line: #d3dce4;
    --focus: #345f86;
    --selected: #e5edf5;
    --disabled: #edf1f4;
    --button: #112d48;
    --button-text: #fff;
}

@media (prefers-color-scheme: dark) {
    html:root:not([data-theme="light"]) {
        color-scheme: dark;
        --paper: #101d2b;
        --surface: #172a3d;
        --soft: #20364c;
        --ink: #e1ebf4;
        --heading: #edf3f9;
        --muted: #b4c6d8;
        --gold: #e3c789;
        --accent: #aecbec;
        --line: #435a71;
        --focus: #aecbec;
        --selected: #233c54;
        --disabled: #20364c;
        --button: #aecbec;
        --button-text: #112d48;
    }
}

html:root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #101d2b;
    --surface: #172a3d;
    --soft: #20364c;
    --ink: #e1ebf4;
    --heading: #edf3f9;
    --muted: #b4c6d8;
    --gold: #e3c789;
    --accent: #aecbec;
    --line: #435a71;
    --focus: #aecbec;
    --selected: #233c54;
    --disabled: #20364c;
    --button: #aecbec;
    --button-text: #112d48;
}

body {
    font-family: "MP Sans", system-ui, sans-serif;
}

h2 {
    font-family: "MP Serif", Georgia, serif;
}

main[data-appointment-management] > :not([data-appointment-slot-manager]) {
    display: none;
}

.appointment-owner-calendar [data-owner-controls] {
    min-inline-size: 0;
    padding: 0;
    margin: 0;
    border: 0;
}

.appointment-owner-calendar .appointment-owner-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    max-width: none;
}

.appointment-owner-calendar [data-owner-marked] {
    position: relative;
}

.appointment-owner-calendar [data-owner-marked]::after {
    position: absolute;
    inset: auto 4px 4px auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.appointment-owner-calendar .appointment-slots {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    max-height: 252px;
    overflow-y: auto;
}

.appointment-owner-calendar .appointment-slots .slot,
.appointment-owner-calendar .button {
    min-height: 40px;
    padding: 6px 12px;
}

.appointment-owner-calendar .appointment-slots .slot {
    height: auto;
}

.appointment-owner-calendar .appointment-slots [data-owner-blocked]:not(:disabled) {
    background: var(--soft);
    color: var(--muted);
    text-decoration: line-through;
}

.appointment-owner-calendar .appointment-slots [data-owner-blocked][aria-pressed="true"] {
    background: var(--selected);
    border-color: var(--accent);
    color: var(--heading);
    text-decoration: none;
}

.appointment-owner-calendar [data-owner-whole][aria-pressed="true"]:not(:disabled) {
    background: var(--selected);
    border-color: var(--accent);
}

.appointment-owner-calendar [data-owner-feedback]:empty {
    display: none;
}

.appointment-owner-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.appointment-owner-existing {
    margin-top: 20px;
}

.appointment-owner-existing summary {
    cursor: pointer;
    font-weight: 600;
}

.appointment-owner-existing ul {
    padding: 0;
    list-style: none;
}

.appointment-owner-existing label {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-block: 4px;
    cursor: pointer;
}

.appointment-owner-existing input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--accent);
}

@media (max-width: 620px) {
    .appointment-owner-calendar .appointment-owner-picker {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }
}

main[data-appointment-content] {
    display: flow-root;
    padding: 4px 5px 12px;
    outline: 0;
}

.appointment-recovery-entry {
    margin-bottom: 16px;
}

.appointment-recovery-entry .appointment-recovery-open {
    color: var(--accent);
    font-size: 16px;
}

.appointment-layout {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 0;
}

.appointment-layout .form-panel {
    padding: clamp(14px, 4vw, 42px);
    border-radius: 6px;
    background: var(--surface);
}

.appointment-layout .form-row {
    gap: 0 20px;
}

.appointment-layout .field {
    margin-block-end: 16px;
}

.appointment-layout .field label {
    margin-block-end: 5px;
}

main[data-appointment-content] .field :is(input:not([type="hidden"], [type="file"]), select),
.appointment-layout .appointment-location-row #format {
    height: 44px;
    min-height: 44px;
    padding-block: 0;
    padding-inline: 10px;
    font-size: 16px;
    line-height: 1.25;
    text-align: start;
}

main[data-appointment-content] .field select,
.appointment-layout .appointment-location-row #format {
    align-items: center;
    justify-content: flex-start;
    padding-inline: 10px 26px;
    background-position: right 9px center;
    text-align-last: start;
}

main[data-appointment-content] .field textarea {
    min-height: 76px;
    padding: 8px 10px;
    font-size: 16px;
    line-height: 1.4;
}

.attachment-picker input[type="file"] {
    width: 1px;
    min-height: 0;
}

.attachment-field label.attachment-picker-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 44px;
    padding: 8px 14px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--soft);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
}

.attachment-picker input:not(:disabled) + label:hover {
    border-color: var(--muted);
}

.attachment-picker input:focus-visible + label {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.attachment-picker input:disabled + label {
    cursor: default;
}

:is(.security-panel[data-security-positioned], .appointment-submit-area > .security-panel):has([data-security-widget]:empty):has([data-security-status]:empty):has([data-security-retry][hidden]) {
    display: none;
}

.appointment-submit-area > .security-panel {
    display: flex;
    flex-direction: column;
    width: min(100%, 320px);
    justify-self: end;
    margin: 0;
}

.appointment-submit-area [data-security-status] {
    order: -1;
}

.calendar-heading {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.calendar-heading [data-calendar-month] {
    grid-column: 2 / -2;
    text-align: center;
    line-height: 1.25;
}

.appointment-owner-calendar .calendar-heading {
    grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
}

.appointment-owner-calendar [data-owner-month] {
    font-size: clamp(0.875rem, 4vw, 1.0625rem);
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
}

.calendar-heading .calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    padding: 0;
    font-size: 0;
}

.appointment-owner-calendar .calendar-heading .calendar-nav {
    inline-size: min(44px, 100%);
}

.appointment-owner-calendar .calendar-heading [data-owner-prev] {
    justify-self: start;
}

.appointment-owner-calendar .calendar-heading [data-owner-next] {
    justify-self: end;
}

.calendar-nav::before {
    content: "";
    box-sizing: border-box;
    width: 9px;
    height: 9px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.calendar-nav:is([data-month-prev], [data-owner-prev])::before {
    transform: translateX(1px) rotate(-135deg);
}

.calendar-nav:is([data-month-next], [data-owner-next])::before {
    transform: translateX(-1px) rotate(45deg);
}

.appointment-layout .button,
.appointment-recovery-dialog .button {
    border-radius: 4px;
}

.appointment-recovery-dialog[open] {
    inset-block: var(--dialog-top, 12px) auto;
    max-height: min(calc(100dvh - 24px), var(--dialog-max-height, 100dvh));
    margin-block: 0;
    overscroll-behavior: contain;
}
