:root {
  --ink:#203a35;
  --muted:#64756e;
  --teal:#176b60;
  --soft:#e7f2ee;
  --line:#dce5df;
  --paper:#fff;
  --canvas:#f5f7f3;
  --warning:#a06119;
  --red:#a33437;
  --radius:18px;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);
  background:var(--canvas);
  font-synthesis:none;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

a {
  color:inherit;
  text-decoration:none;
}

a:hover {
  text-decoration:underline;
}

button,input,select {
  font:inherit;
}

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

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
  outline:3px solid #e5af52;
  outline-offset:3px;
}

h1,h2,h3,p {
  margin:0;
}

h1 {
  font-size:clamp(1.8rem,4vw,2.5rem);
  line-height:1.15;
  letter-spacing:-.045em;
  margin-bottom:10px;
}

h2 {
  font-size:1.2rem;
  line-height:1.3;
}

h3 {
  font-size:1.1rem;
}

p {
  line-height:1.6;
}

button {
  cursor:pointer;
}

button:disabled {
  opacity:.6;
  cursor:wait;
}

.topbar {
  height:86px;
  padding:0 max(24px,calc((100vw - 1120px)/2));
  display:flex;
  justify-content:space-between;
  align-items:center;
  background:var(--paper);
  border-bottom:1px solid var(--line);
  gap:12px;
}

.brand {
  display:flex;
  align-items:center;
  gap:12px;
  font-size:1.1rem;
  font-weight:750;
  line-height:1.2;
}

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

.brand small {
  display:block;
  font-size:.7rem;
  font-weight:500;
  letter-spacing:.07em;
  color:var(--muted);
  margin-top:5px;
}

.brand-icon {
  width:42px;
  height:42px;
  border-radius:14px;
  background:var(--teal);
  color:#fff;
  display:grid;
  place-items:center;
  letter-spacing:-3px;
  padding-right:4px;
  font-size:1.4rem;
}

.shell {
  max-width:1120px;
  margin:0 auto;
  padding:36px 24px 70px;
  min-height:calc(100vh - 160px);
}

.page-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:28px;
}

.eyebrow {
  display:block;
  color:var(--teal);
  font-size:.72rem;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.12em;
  line-height:1.6;
  margin-bottom:9px;
}

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

.lead {
  font-size:1.1rem;
  line-height:1.65;
  max-width:600px;
}

.small {
  font-size:.8rem;
}

.panel {
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:24px;
}

.button {
  min-height:44px;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  border:1px solid transparent;
  border-radius:12px;
  padding:11px 18px;
  font-size:.9rem;
  font-weight:650;
  text-decoration:none;
  line-height:1.25;
}

.button:hover {
  text-decoration:none;
  filter:brightness(.97);
}

.primary {
  background:var(--teal);
  color:white;
}

.secondary {
  background:var(--soft);
  color:var(--teal);
}

.subtle {
  color:var(--teal);
  background:transparent;
  border-color:var(--line);
}

.danger {
  color:var(--red);
  background:#faeeee;
}

.small-button {
  padding:9px 13px;
  font-size:.83rem;
}

.button-row {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}

.filters {
  display:flex;
  align-items:flex-end;
  gap:18px;
  padding:18px;
  margin-bottom:24px;
  flex-wrap:wrap;
}

.filters>div {
  flex:1;
  min-width:150px;
}

label {
  font-size:.84rem;
  font-weight:650;
  display:block;
  margin-bottom:7px;
}

input,select {
  width:100%;
  border:1px solid #c7d4cd;
  min-height:46px;
  background:#fff;
  color:var(--ink);
  border-radius:10px;
  padding:11px 12px;
  font-size:1rem;
  max-width:100%;
}

input[type=checkbox] {
  width:22px;
  height:22px;
  min-height:22px;
  accent-color:var(--teal);
}

.check {
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
}

.next-up {
  display:flex;
  flex-direction:column;
  gap:5px;
  background:var(--soft);
  border:1px solid #c5dfd3;
  border-radius:var(--radius);
  padding:20px 24px;
  margin-bottom:24px;
}

.next-up .eyebrow {
  margin-bottom:0;
}

.next-up strong {
  font-size:1.15rem;
}

.next-up>span:last-of-type {
  font-size:.85rem;
  color:var(--muted);
}

.appointment-list {
  display:grid;
  gap:12px;
}

.appointment {
  display:flex;
  gap:22px;
  padding:20px 22px;
}

.appointment-time {
  width:64px;
  flex-shrink:0;
  display:flex;
  flex-direction:column;
  gap:5px;
  padding-top:3px;
}

.appointment-time strong {
  font-size:1.16rem;
}

.appointment-time span {
  font-size:.8rem;
  color:var(--muted);
}

.appointment-body {
  flex:1;
  min-width:0;
}

.appointment-body h2 {
  font-size:1.05rem;
}

.appointment-body>p {
  font-size:.86rem;
  margin:7px 0 12px;
}

.appointment-body .small {
  font-size:.78rem;
}

.row {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.dot {
  margin:0 7px;
  color:#8faaa0;
}

.badge {
  font-size:.71rem;
  font-weight:650;
  border-radius:99px;
  padding:6px 10px;
  white-space:nowrap;
  line-height:1.4;
  display:inline-block;
}

.neutral {
  background:#f0f3ef;
  color:#5d7067;
}

.good {
  background:#e5f2e7;
  color:#29643c;
}

.warning {
  background:#fcf0dc;
  color:var(--warning);
}

.cancelled {
  background:#fafbf9;
}

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

.form-stack {
  display:flex;
  flex-direction:column;
  gap:7px;
}

.form-stack>input,.form-stack>select,.form-stack>.form-grid {
  margin-bottom:14px;
}

.form-stack>.button {
  margin-top:12px;
}

.form-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.form-narrow {
  max-width:660px;
  margin-bottom:20px;
}

.duration-presets {
  display:flex;
  gap:8px;
  margin-bottom:5px;
}

.chip {
  min-height:40px;
  background:var(--soft);
  color:var(--teal);
  border:1px solid #d1e4db;
  border-radius:10px;
  padding:9px 16px;
}

.validation {
  color:var(--red);
  font-size:.9rem;
}

.validation:empty,.validation-summary-valid {
  display:none;
}

.validation ul {
  padding-left:20px;
}

.notice {
  padding:15px 18px;
  border-radius:12px;
  margin-bottom:20px;
  font-size:.9rem;
}

.success {
  color:#235d39;
  background:#e4f0e6;
}

.back {
  display:inline-block;
  margin-bottom:24px;
  color:var(--teal);
  font-size:.9rem;
  padding:5px 0;
}

.details {
  margin:15px 0 0;
}

.details>div {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  padding:11px 0;
  border-bottom:1px solid #eef2ed;
}

.details>div:last-child {
  border:0;
}

.details dt {
  color:var(--muted);
  font-size:.85rem;
}

.details dd {
  margin:0;
  text-align:right;
  font-size:.9rem;
  font-weight:600;
  overflow-wrap:anywhere;
}

.section-title {
  margin:30px 0 16px;
}

.history-list {
  display:grid;
  gap:10px;
}

.history-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:20px;
}

.history-row p {
  font-size:.8rem;
  color:var(--muted);
  margin-top:5px;
}

.history-row strong {
  font-size:.95rem;
}

.history-row:hover,.child-card:hover {
  text-decoration:none;
  border-color:#9ec4b3;
}

.children-grid,.profile-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}

.child-card {
  display:flex;
  align-items:center;
  gap:16px;
}

.child-card h2 {
  font-size:1rem;
}

.child-card p {
  font-size:.8rem;
  margin-top:4px;
}

.child-card>span:last-child {
  margin-left:auto;
}

.avatar {
  width:46px;
  height:46px;
  flex-shrink:0;
  display:grid;
  place-items:center;
  background:#f4e9d4;
  border-radius:50%;
  font-size:.9rem;
  font-weight:700;
}

.profile-grid .next-up {
  margin-bottom:0;
}

.search-form {
  display:flex;
  gap:12px;
  margin:0 0 24px;
}

.search-form input {
  max-width:500px;
}

.feature-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
}

.feature-grid article {
  padding:28px;
}

.feature-grid article p {
  font-size:.9rem;
  color:var(--muted);
  margin-top:10px;
}

.number {
  color:#6b9982;
  font-size:.75rem;
  display:block;
  margin-bottom:25px;
}

.stat-number {
  font-size:2.4rem;
  color:var(--teal);
  display:block;
  margin:25px 0 15px;
}

.stat-number span {
  font-size:.9rem;
  font-weight:500;
}

.stat-card .details>div {
  gap:10px;
}

.stat-card h2 {
  font-size:1rem;
}

.hero {
  padding:60px 0 68px;
  max-width:850px;
}

.hero h1 {
  font-size:clamp(2.8rem,6.5vw,5rem);
  line-height:1.04;
  font-weight:680;
  letter-spacing:-.06em;
  margin:22px 0;
}

.hero .lead {
  color:var(--muted);
  max-width:560px;
}

.hero .button {
  margin-top:28px;
}

.section {
  margin:0 0 50px;
}

.section>h2 {
  font-size:1.65rem;
  max-width:620px;
  letter-spacing:-.03em;
  margin:0 0 25px;
}

.auth {
  max-width:440px;
  margin:32px auto;
  padding:32px;
}

.auth>p {
  margin-bottom:24px;
}

.auth h1 {
  font-size:2rem;
}

.empty {
  padding:40px 24px;
  text-align:center;
  color:var(--muted);
}

.empty p {
  margin-top:12px;
  font-size:.9rem;
}

.footer {
  text-align:center;
  color:var(--muted);
  font-size:.75rem;
  padding:24px;
}

.bottom-nav {
  display:flex;
  gap:10px;
  justify-content:center;
  position:fixed;
  bottom:20px;
  left:50%;
  transform:translateX(-50%);
  padding:8px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.98);
  box-shadow:0 10px 25px #21433612;
  border-radius:15px;
  z-index:10;
}

.bottom-nav a {
  min-width:120px;
  text-align:center;
  padding:13px 16px;
  font-weight:650;
  font-size:.85rem;
  color:var(--teal);
  border-radius:10px;
}

.bottom-nav a:hover {
  background:var(--soft);
  text-decoration:none;
}

.skip-link {
  position:fixed;
  left:10px;
  top:-100px;
  padding:15px;
  background:#fff;
  z-index:100;
}

.skip-link:focus {
  top:10px;
}

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

@media(max-width:760px) {
  .topbar {
    height:74px;
    padding:0 18px;
  }
  .brand {
    font-size:1rem;
  }
  .brand-icon {
    width:36px;
    height:36px;
    font-size:1.2rem;
  }
  .brand small {
    font-size:.62rem;
  }
  .topbar .button {
    padding:8px 10px;
    font-size:.78rem;
  }
  .shell {
    padding:26px 16px 100px;
  }
  .page-heading {
    gap:15px;
    margin-bottom:22px;
  }
  .page-heading h1 {
    font-size:1.9rem;
  }
  .page-heading .button {
    padding:11px 12px;
    max-width:150px;
    font-size:.8rem;
  }
  .page-heading p.muted {
    font-size:.78rem;
  }
  .filters {
    gap:10px;
    padding:14px;
  }
  .filters>div {
    min-width:120px;
  }
  .filters>button {
    width:100%;
  }
  .appointment {
    gap:13px;
    padding:18px 14px;
  }
  .appointment-time {
    width:52px;
  }
  .appointment-time strong {
    font-size:1rem;
  }
  .appointment-time span {
    font-size:.73rem;
  }
  .appointment-body h2 {
    font-size:1rem;
  }
  .row {
    flex-wrap:wrap;
    gap:8px;
  }
  .badge {
    font-size:.66rem;
    padding:5px 9px;
  }
  .appointment-body>p {
    font-size:.8rem;
  }
  .panel {
    border-radius:15px;
  }
  .next-up {
    padding:18px;
  }
  .next-up strong {
    font-size:1rem;
  }
  .children-grid,.profile-grid,.feature-grid {
    grid-template-columns:1fr;
    gap:12px;
  }
  .panel.form-narrow {
    padding:20px 16px;
  }
  .history-row {
    padding:16px;
    gap:12px;
    flex-wrap:wrap;
  }
  .bottom-nav {
    left:0;
    right:0;
    bottom:0;
    transform:none;
    border-radius:18px 18px 0 0;
    padding:7px 10px calc(7px + env(safe-area-inset-bottom));
    gap:0;
    border-bottom:0;
  }
  .bottom-nav a {
    flex:1;
    min-width:0;
    padding:14px 8px;
  }
  .footer {
    padding-bottom:90px;
  }
  .hero {
    padding:28px 0 45px;
  }
  .hero h1 {
    font-size:3rem;
  }
  .hero .lead {
    font-size:1rem;
  }
  .section>h2 {
    font-size:1.4rem;
  }
  .auth {
    padding:25px 22px;
    margin:16px auto;
  }
  .form-grid {
    gap:12px;
  }
  .feature-grid article {
    padding:22px;
  }
  .number {
    margin-bottom:20px;
  }
  .stat-number {
    margin:18px 0 10px;
  }
  .search-form {
    gap:8px;
  }
  .search-form .button {
    font-size:.8rem;
    padding:10px 12px;
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important;
  }
}

/* Scheduling, editing and copy flows share the existing typography and form controls. */
[hidden] { display:none!important; }
.heading-actions { display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; }
.schedule-heading { align-items:flex-start; }
.schedule-navigation { display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; margin:0 0 20px; }
.schedule-navigation .button-row { margin:0; }
.schedule-navigation .button { padding:10px 12px; }
.update-notice { background:#e8f0ff; color:#29486e; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.is-offline { color:var(--warning); }
.next-up-link:hover { text-decoration:none; border-color:#75aa91; }
.schedule-staff-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; align-items:start; }
.schedule-mobile-list { display:none; }
.schedule-week-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; align-items:start; }
.schedule-day { min-width:0; background:#eef3ed; border:1px solid var(--line); border-radius:var(--radius); padding:12px; }
.schedule-day.is-today { border-color:#84b59c; background:#e9f3ec; }
.unassigned-column { background:#f7f1e5; border-color:#e9dcc1; }
.schedule-column-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 4px 14px; min-height:68px; }
.schedule-column-heading h2 { font-size:.95rem; overflow-wrap:anywhere; }
.schedule-column-heading p { font-size:.75rem; margin-top:4px; }
.schedule-column-heading .button { min-width:40px; min-height:40px; padding:6px 12px; font-size:1.1rem; }
.schedule-empty { color:var(--muted); padding:20px 8px; text-align:center; font-size:.85rem; }
.appointment-body h3 { font-size:1rem; overflow-wrap:anywhere; }
.compact-appointments .appointment { display:block; padding:15px; }
.compact-appointments .appointment-time { flex-direction:row; width:auto; gap:8px; align-items:baseline; margin-bottom:10px; }
.compact-appointments .appointment-time strong { font-size:.95rem; }
.compact-appointments .appointment-time span::before { content:"– "; }
.compact-appointments .row { display:block; }
.compact-appointments .badge { margin-top:7px; white-space:normal; }
.compact-appointments .appointment-body p { line-height:1.5; font-size:.8rem; overflow-wrap:anywhere; }
.compact-appointments .appointment .button { width:100%; font-size:.76rem; }
.text-link { color:var(--teal); text-decoration:underline; text-underline-offset:3px; }
.planned-end { display:block; margin:0 0 16px; padding:12px 14px; border-radius:10px; background:var(--soft); color:var(--teal); font-size:.85rem; line-height:1.5; }
.validation-summary-errors:focus { outline:2px solid var(--red); outline-offset:6px; }
.audit-list { display:grid; gap:10px; }
.audit-entry { padding:0; overflow:hidden; }
.audit-entry summary { cursor:pointer; padding:18px; min-height:64px; }
.audit-entry summary>span { display:inline-flex; flex-direction:column; gap:5px; vertical-align:top; max-width:calc(100% - 24px); }
.audit-entry summary strong { font-size:.9rem; }
.audit-entry summary:focus-visible { outline:3px solid #e5af52; outline-offset:-3px; }
.audit-entry>p { padding:0 20px 18px; }
.audit-changes { margin:0; padding:0 20px 18px; }
.audit-changes>div { display:grid; grid-template-columns:145px 1fr; gap:12px; padding:11px 0; border-top:1px solid var(--line); }
.audit-changes dt { color:var(--muted); font-size:.8rem; }
.audit-changes dd { margin:0; display:flex; flex-wrap:wrap; gap:8px; align-items:baseline; font-size:.85rem; overflow-wrap:anywhere; }
.audit-before { color:var(--muted); }
.audit-arrow { color:#8aa69b; }
.pagination-label { align-self:center; color:var(--muted); font-size:.8rem; }
.copy-steps { list-style:none; display:flex; gap:10px; margin:0 0 22px; padding:0; flex-wrap:wrap; }
.copy-steps li { color:var(--muted); background:#eaf0e8; border-radius:9px; padding:10px 14px; font-size:.8rem; font-weight:650; }
.copy-steps .current { color:white; background:var(--teal); }
.copy-filter-form { max-width:900px; }
.copy-date-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.choice-fieldset { border:0; padding:0; margin:14px 0; min-width:0; }
.choice-fieldset legend { font-size:.84rem; font-weight:650; margin-bottom:10px; }
.choice-grid { display:flex; flex-wrap:wrap; gap:10px; }
.choice-card { display:flex; align-items:center; gap:10px; background:#f5f8f2; padding:12px; border:1px solid var(--line); border-radius:10px; margin:0; min-height:48px; cursor:pointer; }
.choice-card input { flex-shrink:0; }
.choice-card:has(input:checked) { background:var(--soft); border-color:#91bda6; }
.copy-section { max-width:900px; }
.copy-help { margin-bottom:15px; }
.selection-toolbar { display:flex; gap:14px; justify-content:space-between; align-items:center; flex-wrap:wrap; margin:12px 0; }
.selection-toolbar .button-row { margin:0; }
.selection-toolbar output { color:var(--teal); font-size:.85rem; font-weight:650; }
.copy-items { display:grid; gap:10px; margin-bottom:20px; }
.copy-item { display:flex; align-items:flex-start; gap:14px; cursor:pointer; margin:0; font-weight:400; padding:18px; }
.copy-item input { flex-shrink:0; margin:3px 0 0; }
.copy-item:has(input:checked) { border-color:#8bb69f; background:#f0f7f1; }
.copy-item-content { display:flex; flex-direction:column; gap:7px; min-width:0; flex:1; font-size:.85rem; }
.copy-item-content strong { font-size:1rem; overflow-wrap:anywhere; }
.copy-preview-item { display:flex; flex-direction:column; gap:12px; padding:18px; }
.copy-preview-item h3 { font-size:1rem; }
.copy-change { display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:.85rem; }
.copy-confirm { margin-bottom:16px; }
.copy-confirm .button { margin-top:16px; }
form[aria-busy=true] { cursor:progress; }
form[aria-busy=true] button[type=submit] { opacity:.55; }

@media(min-width:1180px) {
  .shell:has(.schedule-page) { max-width:1440px; }
  .schedule-week-grid { grid-template-columns:repeat(7,minmax(0,1fr)); gap:10px; }
  .schedule-week-grid .schedule-day { padding:8px; }
  .schedule-week-grid .compact-appointments .appointment { padding:12px; }
  .schedule-week-grid .schedule-column-heading { display:block; position:relative; padding-right:35px; }
  .schedule-week-grid .schedule-column-heading>.button { position:absolute; top:4px; right:0; min-width:30px; padding:5px 9px; }
}
@media(max-width:900px) {
  .schedule-mobile-list { display:grid; }
  .schedule-staff-grid { display:none; }
  .schedule-week-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .schedule-heading { flex-wrap:wrap; }
  .heading-actions { justify-content:flex-start; }
}
@media(max-width:600px) {
  .schedule-week-grid { grid-template-columns:1fr; }
  .schedule-day { padding:12px; }
  .schedule-column-heading { min-height:58px; }
  .schedule-week-grid .compact-appointments .appointment { display:flex; gap:13px; }
  .schedule-week-grid .compact-appointments .appointment-time { flex-direction:column; width:53px; flex-shrink:0; gap:4px; }
  .schedule-week-grid .compact-appointments .appointment-time span::before { content:""; }
  .schedule-week-grid .compact-appointments .appointment .button { width:auto; }
  .schedule-heading .heading-actions { width:100%; display:grid; grid-template-columns:1fr 1fr; }
  .schedule-heading .heading-actions .button { max-width:none; font-size:.8rem; }
  .schedule-filters { display:grid; grid-template-columns:1fr 1fr; }
  .schedule-filters>div { min-width:0; }
  .schedule-filters>div:first-child { grid-column:1/-1; }
  .schedule-filters>button { grid-column:1/-1; }
  .schedule-navigation { gap:12px; }
  .schedule-navigation .button { min-height:42px; padding:9px 10px; font-size:.78rem; }
  .schedule-navigation .button-row { gap:7px; }
  .update-notice { flex-direction:column; align-items:flex-start; }
  .update-notice .button { width:100%; }
  .copy-date-grid { grid-template-columns:1fr; gap:10px; }
  .copy-filter-form { padding:18px 15px; }
  .copy-steps { gap:6px; }
  .copy-steps li { padding:8px 9px; font-size:.73rem; }
  .choice-grid { display:grid; grid-template-columns:1fr; }
  .copy-item { padding:15px; gap:11px; }
  .copy-item-content { font-size:.8rem; }
  .copy-change { display:grid; grid-template-columns:1fr; gap:5px; }
  .copy-change>span[aria-hidden] { display:none; }
  .copy-change>strong::before { content:"Novo: "; }
  .audit-changes>div { grid-template-columns:1fr; gap:5px; }
  .audit-entry summary { padding:16px; }
}
