:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --surface: #ffffff;
  --text: #1d2424;
  --muted: #64706d;
  --line: #d9dfd8;
  --accent: #1f6f5b;
  --accent-strong: #164f42;
  --error: #9b2f2f;
  --error-bg: #fff1f1;
  --ok: #1f6f5b;
  --ok-bg: #ebf7f2;
  --shadow: 0 18px 45px rgba(29, 36, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand {
  color: var(--text);
  font-size: 24px;
  font-weight: 750;
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.back-link {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.intro {
  max-width: 720px;
  padding: 34px 0 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 8vw, 72px);
  line-height: 0.96;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.notice {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--surface);
  font-size: 15px;
  line-height: 1.5;
}

.notice-ok {
  border-color: rgba(31, 111, 91, 0.25);
  background: var(--ok-bg);
  color: var(--ok);
}

.notice-error {
  border-color: rgba(155, 47, 47, 0.28);
  background: var(--error-bg);
  color: var(--error);
}

.notice ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.notice-link {
  display: block;
  margin-top: 8px;
  color: inherit;
  font-weight: 800;
  text-underline-offset: 3px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
  margin-top: 10px;
}

.signup-form,
.summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.signup-form {
  padding: 24px;
}

fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

legend,
.fields label {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.slot-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 80px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
  background: #fbfcfa;
  cursor: pointer;
}

.slot-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.slot-card:has(input:checked) {
  border-color: var(--accent);
  background: #edf7f3;
  outline: 2px solid rgba(31, 111, 91, 0.15);
}

.slot-card.is-full {
  opacity: 0.56;
  cursor: not-allowed;
}

.slot-time {
  font-size: 19px;
  font-weight: 800;
}

.slot-count {
  color: var(--muted);
  font-size: 13px;
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.fields label {
  display: grid;
  gap: 8px;
}

.fields .wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px 13px;
  background: #fbfcfa;
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(31, 111, 91, 0.16);
}

button {
  width: 100%;
  margin-top: 22px;
  border: 0;
  border-radius: 7px;
  padding: 14px 18px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

.post-visit-link {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.post-visit-link a {
  color: var(--accent-strong);
  font-weight: 700;
  text-underline-offset: 3px;
}

.hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.summary {
  padding: 22px;
}

.summary h2 {
  margin: 0 0 18px;
  font-size: 22px;
  letter-spacing: 0;
}

.summary dl,
.summary dd {
  margin: 0;
}

.summary dl {
  display: grid;
  gap: 14px;
}

.summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary dd {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.summary p {
  margin: 22px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.summary a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 180px)) minmax(140px, auto);
  gap: 12px;
  align-items: stretch;
  margin: 10px 0 24px;
}

.admin-summary div,
.admin-summary a,
.admin-slot {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-summary div,
.admin-summary a {
  display: grid;
  align-content: center;
  min-height: 88px;
  padding: 16px;
  text-decoration: none;
}

.admin-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-summary strong {
  margin-top: 5px;
  font-size: 32px;
  line-height: 1;
}

.admin-summary a {
  color: var(--accent);
  font-weight: 800;
}

.admin-slots {
  display: grid;
  gap: 16px;
}

.admin-slot {
  overflow: hidden;
}

.admin-slot header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.admin-slot h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.admin-slot header span {
  color: var(--muted);
  font-weight: 800;
}

.admin-empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-slot table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.admin-slot th,
.admin-slot td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.admin-slot th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-slot td {
  font-size: 14px;
  line-height: 1.45;
}

.admin-slot tr:last-child td {
  border-bottom: 0;
}

.admin-slot td a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .summary {
    order: -1;
  }

  .admin-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar,
  .page-shell {
    width: min(100% - 22px, 1120px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro {
    padding-top: 16px;
  }

  .lead {
    font-size: 17px;
  }

  .signup-form {
    padding: 16px;
  }

  .fields {
    grid-template-columns: 1fr;
  }
}
