:root {
  color-scheme: light;
  --ink: #18231f;
  --muted: #66736d;
  --paper: #f4f1e8;
  --card: #fffdf7;
  --line: #d9ddd6;
  --accent: #156b52;
  --accent-soft: #dcece5;
  --shadow: 0 18px 50px rgb(29 45 38 / 9%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgb(207 230 219 / 75%), transparent 32rem),
    var(--paper);
}

button, input { font: inherit; }

.page-shell { width: min(70rem, calc(100% - 2rem)); margin: 0 auto; padding: 3.5rem 0 6rem; }
.hero { max-width: 46rem; margin-bottom: 2rem; }
.eyebrow { margin: 0 0 .45rem; color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .5rem; font-size: clamp(2.3rem, 7vw, 4.8rem); line-height: .98; letter-spacing: -.055em; }
h2 { margin-bottom: .25rem; font-size: clamp(1.5rem, 4vw, 2.3rem); letter-spacing: -.035em; }
.intro, .description { color: var(--muted); line-height: 1.65; }
.manage-link, .back-link { color: var(--accent); font-weight: 750; text-decoration: none; }
.manage-link { display: inline-block; margin-top: .4rem; }
.identity-card { display: inline-flex; align-items: baseline; gap: .55rem; margin-top: .6rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .65rem; background: rgb(255 253 247 / 75%); }
.identity-card strong { font-size: .88rem; }
.identity-card span { color: var(--muted); font-size: .76rem; }
.protection-control { display: flex; align-items: center; gap: .55rem; margin-top: .8rem; color: var(--muted); font-size: .82rem; }
.text-button { padding: 0; color: var(--accent); font-weight: 750; cursor: pointer; border: 0; background: transparent; text-decoration: underline; }
.protected-label { color: var(--muted); font-size: .8rem; font-style: italic; }

.messages { margin: 0 0 1.25rem; padding: .8rem 1rem; border: 1px solid #a7cfbc; border-radius: .75rem; background: var(--accent-soft); }
.messages p { margin: 0; }
.new-link-card { margin: 0 0 1rem; padding: 1.2rem 1.4rem; border: 2px solid var(--accent); border-radius: 1rem; background: var(--card); box-shadow: var(--shadow); }
.new-link-card h2, .new-link-card p { margin-bottom: .45rem; }
.copy-link-row { display: flex; gap: .6rem; margin-top: .85rem; }
.copy-link-row input { min-width: 0; flex: 1; padding: .75rem .8rem; border: 1px solid var(--line); border-radius: .6rem; background: white; }

.event-tabs { display: flex; gap: .65rem; margin: 0 0 1rem; padding-bottom: .35rem; overflow-x: auto; }
.event-tabs a { min-width: 11rem; padding: .8rem .9rem; color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: .8rem; background: rgb(255 253 247 / 70%); }
.event-tabs a[aria-current="page"] { color: white; border-color: var(--accent); background: var(--accent); }
.event-tabs span { display: block; margin-top: .2rem; font-size: .78rem; opacity: .75; }

.event-card { overflow: hidden; border: 1px solid var(--line); border-radius: 1.1rem; background: var(--card); box-shadow: var(--shadow); }
.event-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; padding: 1.35rem 1.5rem 1rem; }
.event-heading time { color: var(--muted); font-weight: 650; text-align: right; }
.description { padding: 0 1.5rem; }
.attendance-summary { display: flex; gap: .5rem; padding: .75rem 1.5rem 1rem; flex-wrap: wrap; }
.attendance-summary span { padding: .35rem .6rem; color: var(--muted); font-size: .78rem; border: 1px solid var(--line); border-radius: 999px; background: white; }
.attendance-summary strong { color: var(--ink); font-size: .95rem; }
.attendance-list { border-top: 1px solid var(--line); }
.person-row { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(25rem, 2fr); align-items: center; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.person-row:last-child { border-bottom: 0; }
.person-summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.current-status { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.status-actions { display: grid; grid-template-columns: repeat(4, 2rem); justify-content: end; gap: .3rem; }
.status-actions button { position: relative; display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; padding: 0; color: var(--ink); cursor: pointer; border: 1px solid var(--line); border-radius: .38rem; background: white; }
.status-actions button::after { position: absolute; z-index: 2; right: 50%; bottom: calc(100% + .45rem); padding: .3rem .45rem; color: white; font-size: .72rem; font-weight: 700; white-space: nowrap; pointer-events: none; content: attr(data-label); border-radius: .35rem; background: var(--ink); opacity: 0; transform: translateX(50%) translateY(.2rem); transition: opacity .12s ease, transform .12s ease; }
.status-actions button:hover::after, .status-actions button:focus-visible::after { opacity: 1; transform: translateX(50%) translateY(0); }
.status-symbol { font-size: 1.08rem; font-weight: 850; line-height: 1; }
.status-actions button:hover { border-color: var(--accent); }
.status-actions button[aria-pressed="true"] { color: white; border-color: var(--accent); background: var(--accent); }
.empty-state { padding: 2rem; border: 1px dashed var(--line); border-radius: 1rem; background: rgb(255 253 247 / 70%); }
.compact-hero h1 { font-size: clamp(2.2rem, 5vw, 3.7rem); }
.back-link { display: inline-block; margin-bottom: 2rem; }
.management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.access-card { display: flex; justify-content: space-between; align-items: center; gap: 2rem; margin-bottom: 1rem; padding: 1.2rem 1.4rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--accent-soft); }
.access-card h2, .access-card p { margin-bottom: .4rem; }
.access-card form { display: grid; gap: .7rem; justify-items: start; min-width: 18rem; }
.switch-label { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.management-card { padding: 1.4rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--card); box-shadow: var(--shadow); }
.stacked-form { display: grid; gap: .9rem; }
.stacked-form > div { display: grid; gap: .35rem; }
.stacked-form label { font-size: .82rem; font-weight: 750; }
.stacked-form input:not([type="checkbox"]), .stacked-form textarea, .stacked-form select { width: 100%; padding: .75rem .8rem; border: 1px solid var(--line); border-radius: .6rem; background: white; }
.stacked-form .errorlist { margin: 0; padding-left: 1.2rem; color: #9e332c; }
.primary-button { justify-self: start; padding: .75rem 1rem; color: white; font-weight: 750; cursor: pointer; border: 0; border-radius: .65rem; background: var(--accent); }
.record-list { margin-top: 1.5rem; border-top: 1px solid var(--line); }
.record-list h3 { margin: 1rem 0 .2rem; font-size: 1rem; }
.older-records { border-bottom: 1px solid var(--line); }
.older-records summary { padding: .9rem 0; color: var(--accent); font-weight: 750; cursor: pointer; }
.record-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.record-row span { display: block; margin-top: .15rem; color: var(--muted); font-size: .8rem; }
.record-row.is-inactive { opacity: .55; }
.inline-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.member-actions { display: grid; justify-items: end; gap: .4rem; }
.inline-actions a { color: var(--accent); font-weight: 700; }
.quiet-button { padding: .4rem .55rem; color: var(--accent); cursor: pointer; border: 1px solid var(--line); border-radius: .45rem; background: white; }
.quiet-button.danger { color: #9e332c; }
.current-link-label { color: var(--muted); font-size: .8rem; }
.empty-copy { margin: 1rem 0 0; color: var(--muted); }
.narrow-shell { max-width: 42rem; }
.directory-shell { max-width: 62rem; }
.directory-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1rem; align-items: start; }
.directory-list { margin-top: 1rem; border-top: 1px solid var(--line); }
.directory-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.directory-row span { display: block; margin-top: .15rem; color: var(--muted); font-size: .8rem; }
.primary-link, .quiet-link { padding: .55rem .75rem; font-weight: 750; text-decoration: none; border-radius: .55rem; }
.primary-link { color: white; background: var(--accent); }
.quiet-link { color: var(--accent); border: 1px solid var(--line); background: white; }
.privacy-note, .access-card small { color: var(--muted); font-size: .78rem; line-height: 1.5; }

@media (max-width: 46rem) {
  .page-shell { width: min(100% - 1rem, 40rem); padding-top: 2rem; }
  .event-heading { display: block; }
  .event-heading time { display: block; margin-top: .5rem; text-align: left; }
  .person-row { display: block; padding: 1rem; }
  .status-actions { margin-top: .75rem; grid-template-columns: repeat(4, 2.25rem); justify-content: start; }
  .status-actions button { width: 2.25rem; height: 2.25rem; }
  .management-grid { grid-template-columns: 1fr; }
  .directory-grid { grid-template-columns: 1fr; }
  .access-card { align-items: flex-start; flex-direction: column; }
  .access-card form { min-width: 0; }
  .record-row { align-items: flex-start; flex-direction: column; }
  .member-actions { justify-items: start; }
  .copy-link-row { align-items: stretch; flex-direction: column; }
}
