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

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--fg);
    font: 15px/1.5 var(--font);
}

h1,
h2,
h3 {
    margin: 0 0 0.75rem;
    line-height: 1.25;
    font-weight: 600;
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.15rem;
}

h3 {
    font-size: 1rem;
}

p {
    margin: 0 0 0.75rem;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

code,
pre,
.mono {
    font-family: var(--mono);
    font-size: 0.875em;
}

code {
    padding: 0.1em 0.35em;
    background: var(--surface-2);
    border-radius: 4px;
}

pre.code {
    margin: 0 0 0.75rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

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

.icon {
    flex: none;
    width: var(--icon);
    height: var(--icon);
}

.small {
    font-size: 0.8rem;
}

.card {
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.6rem 0.5rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}

.table td.actions {
    text-align: right;
    white-space: nowrap;
}

.table td.actions form {
    margin: 0;
}

.badge {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
}

.badge-muted {
    color: var(--muted);
    background: var(--surface-2);
}

code.scope {
    white-space: nowrap;
}

.tick {
    flex: none;
    display: inline-block;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    padding: 0;
    vertical-align: -0.2em;
    background: var(--bg);
    border: 1.5px solid var(--c, var(--border-strong));
    border-radius: 50%;
    cursor: pointer;
}

.tick:hover {
    border-color: var(--accent);
}

.tick[aria-pressed="true"],
.tick[aria-checked="true"] {
    background: var(--c, var(--accent));
    border-color: var(--c, var(--accent));
}

.tick-form {
    display: flex;
    margin: 0;
}
.modal {
    width: min(36rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 0;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    overflow: auto;
}

.modal::backdrop {
    background: rgb(0 0 0 / 0.35);
}

.modal-body {
    padding: 1.25rem;
}

.modal .event-form,
.modal .event-detail {
    max-width: none;
    margin: 0;
}

@media (max-width: 640px) {
    .modal {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }
}

.dim {
    opacity: 0.2;
}

.cal-findbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
}

.cal-findbar input {
    flex: 1 1 24rem;
    max-width: 32rem;
    height: 1.75rem;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
}

/* Standalone documents: privacy, terms. Narrow measure so long prose stays
   readable on a wide screen, and the same tokens as the rest of the app. */
.doc {
    max-width: 44rem;
    margin: 1.5rem auto 3rem;
    padding: 0 1rem;
    color: var(--fg);
    line-height: 1.65;
}

.doc h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
}

.doc h2 {
    margin: 2rem 0 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 1.0625rem;
}

.doc p {
    margin: 0 0 0.75rem;
}

.doc .lede {
    margin-bottom: 1.5rem;
    color: var(--muted);
    font-size: 1.0625rem;
}

.doc .muted {
    margin-top: 2rem;
    color: var(--muted);
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .doc {
        margin-top: 1rem;
    }

    .doc h1 {
        font-size: 1.5rem;
    }
}
