:root {
  --bg: #f4f2ee;
  --bg-elevated: #fff;
  --fg: #1c1915;
  --fg-muted: #6b6560;
  --fg-subtle: #9a948c;
  --accent: #71b739;
  --accent-fg: #fff;
  --accent-soft: #e7f3d8;
  --chip: #e7f3d8;
  --line: rgba(28, 25, 21, 0.08);
  --line-strong: rgba(28, 25, 21, 0.16);
  --danger: #b42318;
  --ok: #71b739;
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "DM Sans", system-ui, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.9rem;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-border: 0 0 0 1px rgba(28, 25, 21, 0.06), 0 8px 24px rgba(28, 25, 21, 0.04);
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
  --motion-fast: 160ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font); color: var(--fg); background: var(--bg);
  line-height: 1.5; display: flex; flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--fg); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 var(--space-3); }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
p { margin: 0 0 var(--space-3); }
.g { color: var(--accent); }
.muted { color: var(--fg-muted); }
.tiny { font-size: var(--text-xs); }
.lead { font-size: 1.05rem; color: var(--fg-muted); max-width: 36rem; }
.eyebrow {
  font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-subtle); font-weight: 600; margin: 0 0 8px;
}
.skip {
  position: absolute; left: -999px; top: 0;
}
.skip:focus { left: 8px; background: #fff; padding: 8px; z-index: 9; }
.wrap { width: min(1080px, calc(100% - 40px)); margin-inline: auto; }
.wrap-wide { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.narrow { width: min(560px, calc(100% - 40px)); }
.top {
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.top-inner, .foot-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); min-height: 64px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 32px; width: auto; }
.top-nav { display: flex; align-items: center; gap: var(--space-4); font-size: var(--text-sm); }
.top-nav a { text-decoration: none; color: var(--fg-muted); }
.inline { display: inline; }
.linkish {
  background: none; border: 0; padding: 0; font: inherit; color: var(--fg-muted);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.linkish.danger, .danger { color: var(--danger); }
main { flex: 1 0 auto; padding-bottom: var(--space-7); }
.foot {
  border-top: 3px solid var(--accent);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  background: var(--bg);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.foot-inner { min-height: 52px; flex-wrap: wrap; }
.foot-stack { padding: 6px 0 18px; }
.foot-credit { margin: 0; }
.foot-chip {
  display: inline-flex; align-items: center;
  min-height: 28px; padding: 0 12px;
  border-radius: 999px; background: var(--accent-soft);
  color: var(--fg); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.01em;
}
.foot-legal { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.foot a { color: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--accent-fg); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn-ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: var(--text-sm); }
.btn-danger { background: var(--danger); color: #fff; }
.card {
  background: var(--bg-elevated); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-border);
}
.form-card { padding: 24px; }
.flash {
  margin: var(--space-4) 0; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}
.flash-ok { background: var(--accent-soft); }
.flash-err { background: #fde8e6; color: #7a1c16; }

.hero { padding: var(--space-8) 0 var(--space-7); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-7); align-items: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }

.home { padding: var(--space-7) 0 var(--space-8); }
.home-intro {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--space-6); flex-wrap: wrap;
  margin-bottom: var(--space-6); padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}
.home-intro h1 { margin: 0; max-width: 8ch; }
.home-intro .lead { margin: var(--space-3) 0 0; max-width: 28rem; }
.home-meta { text-align: right; color: var(--fg-muted); font-size: var(--text-sm); line-height: 1.7; }
.home-meta a { color: inherit; }
.home-kicker {
  font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-subtle); font-weight: 600; margin: 0 0 var(--space-3);
}
.home-board {
  display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: var(--space-6); align-items: start;
}
.home-people { display: flex; flex-direction: column; gap: 8px; }
.home-person {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-md);
  text-decoration: none; color: inherit;
  background: var(--bg-elevated); box-shadow: var(--shadow-border);
}
.home-person strong { display: block; font-size: var(--text-sm); }
.home-person .muted { font-size: var(--text-xs); }
.home-person.is-on { box-shadow: 0 0 0 2px var(--accent); }
.home-person .avatar { width: 36px; height: 36px; border-radius: 10px; font-size: 1rem; }
.home-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); align-items: stretch; }

.host { padding: var(--space-6) 0 var(--space-8); }
.host-hero {
  display: flex; align-items: flex-start; gap: var(--space-5);
  margin: 0 0 var(--space-6); padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}
.host-avatar { width: 72px; height: 72px; border-radius: 20px; font-size: 1.8rem; flex: 0 0 auto; }
.host-copy h1 { margin: 0 0 8px; }
.host-copy .lead { margin: 0 0 12px; }
.host-meta {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0; color: var(--fg-muted); font-size: var(--text-sm);
}
.host-meta .icon { width: 15px; height: 15px; }

.section { padding-bottom: var(--space-8); }
.section-title { margin-bottom: var(--space-5); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.step-n { display: block; font-family: var(--font-display); color: var(--fg-subtle); margin-bottom: var(--space-2); }

.auth { padding: var(--space-8) 0; display: grid; place-items: start center; }
.auth-card { width: min(420px, 100%); }
.hint { font-size: var(--text-sm); color: var(--fg-muted); }
.hint code { font-size: 0.85em; }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
label { display: flex; flex-direction: column; gap: 6px; font-size: var(--text-sm); font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  min-height: 44px; padding: 10px 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .slot:focus-visible, .icon-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.choice { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-3); }
.choice legend { font-size: var(--text-sm); font-weight: 500; margin-bottom: var(--space-2); }
.choice legend .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.radio, .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.radio input, .check input { min-height: 18px; width: 18px; }

.crumb { display: flex; gap: 8px; color: var(--fg-muted); font-size: var(--text-sm); }
.member-grid, .type-list, .type-admin { display: grid; gap: var(--space-4); }
.member-grid { grid-template-columns: 1fr; }
.type-list, .type-admin { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.member-card, .type-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-4); align-items: center;
  text-decoration: none; color: inherit;
  transition: box-shadow var(--motion-fast) var(--ease-out), transform var(--motion-fast) var(--ease-out);
}
.type-card { grid-template-columns: 1fr; align-items: stretch; display: flex; flex-direction: column; gap: 14px; height: 100%; min-height: 0; }
.member-card:hover, .type-card:hover { box-shadow: 0 0 0 1px rgba(28,25,21,.1), 0 10px 28px rgba(28,25,21,.07); transform: translateY(-1px); }
.type-card h2 { font-size: 1.35rem; margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
.type-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.type-dur {
  flex: 0 0 auto;
  font-size: 11px; font-weight: 600; color: var(--fg-muted);
  background: var(--bg); border-radius: 999px; padding: 5px 9px; white-space: nowrap;
}
.type-card .go { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); width: 100%; }
.type-desc {
  margin: 0; font-size: var(--text-sm); color: var(--fg-muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.slot-desc { max-width: 38rem; color: var(--fg-muted); margin: 8px 0 0; line-height: 1.45; }
.avatar {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-fg);
  font-family: var(--font-display); font-size: 1.3rem;
  object-fit: cover;
}
img.avatar { padding: 0; background: var(--bg-elevated); }
.go { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-muted); font-size: var(--text-sm); }
.icon { width: 18px; height: 18px; display: block; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.type-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px 0 6px;
  border-radius: 999px; background: var(--chip); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.chip .icon { width: 13px; height: 13px; }
.chip-mute { background: var(--bg); color: var(--fg-muted); }
.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;
}

.slot-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5);
}
.slot-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tz-form { margin: 0; }
.tz-form select { min-height: 40px; font-size: var(--text-sm); background: var(--bg-elevated); }
.week-nav { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); font-weight: 600; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; background: var(--bg-elevated); border-radius: 12px;
  box-shadow: var(--shadow-border); cursor: pointer; color: inherit; text-decoration: none;
}
.week { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-3); align-items: start; }
.day h2 { font-size: var(--text-sm); }
.day.is-past { opacity: 0.45; }
.slot-col { display: flex; flex-direction: column; gap: 8px; }
.slot {
  display: grid; place-items: center; min-height: 40px;
  background: var(--bg-elevated); border-radius: 12px; text-decoration: none;
  font-weight: 600; font-size: var(--text-sm); box-shadow: var(--shadow-border);
}
.slot:hover { box-shadow: 0 0 0 2px var(--accent); }
.slot-filter { margin-bottom: var(--space-5); }
.loc-pick { border: 0; padding: 0; margin: 0 0 var(--space-4); }
.loc-pick legend { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-3); }
.loc-grid { display: grid; gap: 12px; align-items: stretch; }
.loc-option {
  position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 8px;
  height: 100%; min-height: 118px; padding: 18px 12px 16px;
  border-radius: var(--radius-md); background: var(--bg);
  border: 2px solid transparent; cursor: pointer;
}
.loc-option input { position: absolute; opacity: 0; pointer-events: none; }
.loc-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.loc-ico { color: var(--accent); }
.loc-ico .icon { width: 22px; height: 22px; }
.loc-copy { display: flex; flex-direction: column; gap: 2px; }
.loc-copy strong { font-size: var(--text-sm); }
.loc-copy span { font-size: var(--text-xs); color: var(--fg-muted); font-weight: 400; }
.addr-field { margin-top: var(--space-3); }
.addr-wrap { position: relative; display: block; }
.addr-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fg-muted); }
.addr-wrap input { padding-left: 40px; width: 100%; }

.summary p { margin: 0 0 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--danger); }
.mono-link { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--text-sm); word-break: break-all; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.block-title { margin: var(--space-6) 0 var(--space-3); }
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--fg-muted); font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; }

.hours-row { display: grid; grid-template-columns: 1fr 1fr auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.field-kicker { font-weight: 600; margin: var(--space-2) 0 8px; }
.field-kicker .muted { font-weight: 400; }
.field-row {
  display: grid; grid-template-columns: 1.2fr 0.8fr 0.65fr 0.75fr auto;
  gap: 8px; align-items: start; margin-bottom: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.field-row.is-off { opacity: 0.45; }
.field-opts { grid-column: 1 / -1; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.invite {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.2rem; letter-spacing: 0.08em;
  padding: 12px 16px; background: var(--bg); border-radius: var(--radius-sm);
}
.plain { list-style: none; padding: 0; }
.plain li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.legal { padding: var(--space-6) 0 var(--space-8); max-width: 760px; }
.legal-body { font-size: var(--text-sm); line-height: 1.55; }
.legal-body h2 { font-size: 1.05rem; margin: var(--space-5) 0 var(--space-3); }
.legal-body p, .legal-body ul { margin: 0 0 var(--space-3); }
.legal-body a { overflow-wrap: anywhere; }
.embed-body { background: var(--bg); }
.embed-body .wrap { width: min(1080px, calc(100% - 24px)); }
.embed-body .crumb { display: none; }
.embed-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px; font-size: var(--text-xs); color: var(--fg-muted);
  padding: 12px 16px 20px;
}
.embed-copy { margin-top: 12px; }
.embed-copy textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; min-height: 88px;
}
.type-switch { display: block; margin-top: 10px; max-width: 280px; }
.type-switch select { min-height: 40px; }

.app-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.app-shell { display: grid; grid-template-columns: 240px 1fr; flex: 1; min-height: 0; }
.side {
  padding: var(--space-5) var(--space-4);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: var(--space-4);
  background: var(--bg);
}
.side-team { margin: 0; font-size: var(--text-xs); color: var(--fg-muted); }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  text-decoration: none; color: var(--fg-muted); padding: 8px 10px; border-radius: 10px; font-size: var(--text-sm);
}
.side-nav a.is-active { background: var(--bg-elevated); color: var(--fg); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side-public { font-size: var(--text-sm); }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px; border-bottom: 1px solid var(--line); gap: 12px;
}
.app-top-title { font-weight: 700; }
.app-top-user { font-size: var(--text-sm); color: var(--fg-muted); }
.app-content { padding: 28px; flex: 1; }
.app-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 16px; padding: 14px 20px;
  border-top: 1px solid var(--line); background: var(--bg);
}
.app-foot .foot-legal { font-size: var(--text-sm); color: var(--fg-muted); }
.app-foot a { color: inherit; }

@media (min-width: 560px) {
  .loc-grid { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-grid, .steps, .dash-grid, .week, .home-board, .home-types, .type-admin, .type-list { grid-template-columns: 1fr; }
  .host-hero { gap: var(--space-4); }
  .app-shell { grid-template-columns: 1fr; }
  .side {
    border-right: 0; border-bottom: 1px solid var(--line);
    flex-direction: column; gap: 10px; padding: 12px 16px;
  }
  .side-nav {
    flex-direction: row; overflow-x: auto; width: 100%;
    -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding-bottom: 4px;
  }
  .side-nav a { white-space: nowrap; flex: 0 0 auto; }
  .side-foot {
    margin-top: 0; width: 100%; flex-direction: row; flex-wrap: wrap;
    align-items: center; gap: 14px;
  }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .hours-row, .field-row { grid-template-columns: 1fr 1fr auto; }
  .app-content { padding: 16px; }
  .app-top { padding: 12px 16px; }
  .form-card { padding: 16px; }
  .row-between { flex-wrap: wrap; }
  .table { font-size: 13px; }
}
@media (max-width: 640px) {
  .grid-3, .hours-row, .field-row { grid-template-columns: 1fr; }
  .app-top-user { display: none; }
  .host-hero { flex-direction: column; }
  .embed-copy textarea { min-height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.guide {
  list-style: none; margin: 0 0 var(--space-5); padding: 0; counter-reset: g;
  display: grid; gap: 12px;
}
.guide li {
  counter-increment: g;
  display: grid; grid-template-columns: 36px 1fr; gap: 12px 14px;
  padding: 14px 16px; background: var(--bg-elevated); border-radius: var(--radius-md);
  box-shadow: var(--shadow-border);
}
.guide li::before {
  content: counter(g);
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-fg);
  font-weight: 700; font-family: var(--font-display);
  grid-row: 1 / span 2;
}
.guide li strong { display: block; margin: 0; align-self: center; }
.guide li span, .guide li ul { grid-column: 2; color: var(--fg-muted); font-size: var(--text-sm); }
.guide li ul { margin: 4px 0 8px; padding-left: 1.1rem; }
.guide li input[readonly] { grid-column: 2; margin: 0; font-size: 13px; }
