:root {
  /* Pilates Retreat brand (same values as pilatesretreat.com) */
  --brand-green: #34604F;
  --brand-gold: #DAAB6B;
  --brand-cream: #F1ECE3;

  --bg: var(--brand-cream);
  --surface: #ffffff;
  --ink: #26352f;
  --muted: #5f6b65;
  --line: #e3dccf;
  --accent: var(--brand-green);
  --accent-ink: #ffffff;
  --accent-soft: #e3ece7;
  --gold-soft: #f7ecdb;
  --warn: #8a5a1f;
  --warn-soft: var(--gold-soft);
  --danger: #a33b3b;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1, h2, h3 { font-family: "Playfair Display", Georgia, serif; font-weight: 600; margin: 0 0 .5rem; color: var(--brand-green); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: .9rem; line-height: 1.2; min-width: 0; }
.brand-logo { display: block; height: 44px; width: auto; }
.brand-sub {
  font-size: .78rem; color: var(--brand-green); letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
  padding-left: .9rem; border-left: 2px solid var(--brand-gold);
}
.who { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.who span { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.container { max-width: 960px; margin: 0 auto; padding: 1.25rem 16px 4rem; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem;
}
.hero { text-align: center; padding: 2.5rem 1.25rem; }
.hero p { max-width: 34rem; margin: .5rem auto 1.5rem; }
.actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.btn {
  font: inherit; font-weight: 600; border-radius: 999px; padding: .55rem 1.2rem; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-quiet { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: .3rem .85rem; font-size: .85rem; }
.btn:focus-visible, input:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tab {
  font: inherit; background: none; border: none; padding: .6rem .9rem; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--brand-green); border-bottom-color: var(--brand-gold); font-weight: 600; }
.badge {
  display: inline-block; min-width: 1.3rem; padding: 0 .35rem; border-radius: 999px; font-size: .75rem;
  background: var(--brand-gold); color: var(--ink); font-weight: 600; text-align: center; margin-left: .3rem;
}

.rangebar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.rangebar .label { font-weight: 600; }

.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; overflow: hidden; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: #fbf9f5; }
.day-head .date { font-weight: 600; color: var(--brand-green); }
.day-body { padding: .6rem 1rem .8rem; }
.day.past { opacity: .55; }
.day.today { border-color: var(--brand-gold); }
.day.today .day-head { background: var(--gold-soft); }

.class-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.class-row:last-child { border-bottom: none; }
.class-info { min-width: 0; }
.class-time { font-weight: 600; }
.class-meta { font-size: .85rem; color: var(--muted); }
.class-row.cancelled .class-time, .class-row.cancelled .class-name { text-decoration: line-through; color: var(--muted); }

.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; background: var(--accent-soft); color: var(--accent); margin: .15rem .25rem .15rem 0; }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-plain { background: var(--brand-cream); color: var(--ink); }
.pill-gold { background: var(--gold-soft); color: #7a4a14; border: 1px solid var(--brand-gold); font-weight: 600; }

.available-list { margin-top: .3rem; }
.subs-card { border-color: var(--brand-gold); background: #fffdf8; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-top: .5rem; }
.field { display: flex; flex-direction: column; gap: .25rem; }
input[type="date"] { font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.timeoff-line { margin-top: .5rem; }
.class-row.conflict {
  background: #fbeeee; border-left: 4px solid var(--danger); border-bottom-style: solid;
  padding-left: .6rem; margin: .25rem -.4rem; padding-right: .4rem; border-radius: 6px;
}
.pill-conflict { background: #f6dcdc; color: var(--danger); font-weight: 600; }
.notice-conflict { background: #fbeeee; color: var(--danger); border: 1px solid #efc4c4; }
.notice-conflict .small { color: var(--ink); margin-top: .25rem; }
.subs-card h2 { font-size: 1.1rem; }
.assign-controls { margin-top: .45rem; }
.assignment { margin-bottom: .3rem; }
.assign-row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
select.assign-select {
  font: inherit; font-size: .85rem; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); max-width: 100%;
}

.availability-summary { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }

.editor { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.editor label { font-size: .9rem; }
.window-row { display: flex; align-items: center; gap: .5rem; margin: .4rem 0; flex-wrap: wrap; }
input[type="time"], textarea {
  font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
}
textarea { width: 100%; min-height: 3.2rem; resize: vertical; margin-top: .25rem; }
.editor-actions { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }

table.users { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.users th, table.users td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.users th { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.table-wrap { overflow-x: auto; }

.notice { padding: .75rem 1rem; border-radius: 8px; background: var(--warn-soft); color: var(--warn); margin-bottom: 1rem; }
.error { color: var(--danger); }

.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); max-width: calc(100% - 32px);
  background: var(--brand-green); color: #fff; padding: .6rem 1.1rem; border-radius: 999px; font-size: .9rem; z-index: 20;
}
.toast.error-toast { background: var(--danger); }

@media (max-width: 560px) {
  .class-row { flex-direction: column; align-items: flex-start; }
  .brand-sub { display: none; }
  .brand-logo { height: 36px; }
}
