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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2 { font-family: var(--font-heading); line-height: 1.25; margin: 0 0 .75rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; margin-top: 1.75rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand-primary); }
small { color: var(--text-muted); font-weight: 400; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: .75rem; padding-top: .75rem; padding-bottom: .75rem; }
.logo { width: 40px; height: 40px; }
.brand { font-family: var(--font-heading); font-weight: 600; font-size: 1.1rem; }

main.wrap { flex: 1; padding-top: 2rem; padding-bottom: 2rem; }

.site-footer { padding: 1.5rem 0; color: var(--text-muted); font-size: .9rem; }
.site-footer a { color: inherit; margin-right: 1rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.card.narrow { max-width: 520px; margin: 0 auto; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.inline { display: inline; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline-form input { flex: 1 1 200px; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-family: var(--font-heading); font-weight: 600; font-size: 1.15rem; margin-bottom: .75rem; padding: 0; }

label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; }

input[type="text"], input[type="email"], input[type="password"], textarea {
    width: 100%;
    font: inherit;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    padding: .6rem .75rem;
}
textarea { resize: vertical; }

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

.button {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--brand-primary);
    border-radius: var(--radius-small);
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    padding: .7rem 1.25rem;
}
.button:hover { background: var(--brand-primary-hover); }
.button-secondary { background: transparent; color: var(--brand-primary); }
.button-secondary:hover { background: var(--bg); }
.button-danger { background: var(--danger); border-color: var(--danger); }
.button-danger:hover { background: var(--danger); filter: brightness(.9); }

.link-button {
    font: inherit;
    background: none;
    border: 0;
    padding: 0;
    color: var(--brand-primary);
    text-decoration: underline;
    cursor: pointer;
}
.link-button.danger { color: var(--danger); }

.alert {
    background: var(--bg);
    border-left: 4px solid var(--brand-accent);
    border-radius: var(--radius-small);
    padding: .75rem 1rem;
}
.alert p:last-child { margin-bottom: 0; }
.alert-error { border-left-color: var(--danger); }

.hint { color: var(--text-muted); font-size: .9rem; margin: 0; }

.day + .day { margin-top: 1.25rem; }
.day-title { font-size: 1rem; margin: 0 0 .5rem; }
.slot-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.slot { position: relative; display: block; }
.slot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.slot span {
    display: block;
    min-width: 5rem;
    text-align: center;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--surface);
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}
.slot span:hover { border-color: var(--brand-primary); }
.slot input:checked + span { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-on-primary); }
.slot input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.when { font-size: 1.2rem; font-weight: 600; }
.phone { font-size: 1.6rem; font-weight: 700; }
.phone a { text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

.plain { padding-left: 1.1rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .5rem; border-bottom: 1px solid var(--border); }
tr.muted td { color: var(--text-muted); }
