:root {
  --ink: #17221f;
  --ink-soft: #41504b;
  --muted: #6d7a75;
  --line: #dbe4df;
  --line-strong: #c7d4ce;
  --page: #f2f6f4;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --teal: #14786f;
  --teal-dark: #0f5f58;
  --teal-soft: #e4f2ee;
  --blue: #2f648c;
  --blue-soft: #eaf1f7;
  --amber: #a9671d;
  --amber-soft: #fbf0df;
  --danger: #b5483b;
  --danger-soft: #f9e9e6;
  --shadow: 0 12px 32px rgba(22, 44, 37, 0.08);
  --header-height: 72px;
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    "Source Han Sans SC",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(20, 120, 111, 0.26);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px max(20px, calc((100vw - 1120px) / 2));
  color: #f7fbf9;
  background: #173c37;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #d8f2e8;
  border: 1px solid rgba(216, 242, 232, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 17px;
  font-weight: 650;
  white-space: nowrap;
}

.brand-copy small {
  color: rgba(247, 251, 249, 0.65);
  font-size: 11px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weekend-pill,
.trial-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.weekend-pill {
  color: #eaf7f2;
  border: 1px solid rgba(234, 247, 242, 0.18);
  background: rgba(255, 255, 255, 0.07);
}

.trial-pill {
  color: #173c37;
  background: #d6e9df;
}

.role-nav {
  display: flex;
  align-items: stretch;
}

.role-nav-desktop {
  gap: 4px;
  min-height: 56px;
  padding: 7px max(20px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.role-nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.role-nav-desktop .role-nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 116px;
  min-height: 40px;
  padding: 0 16px;
  color: var(--muted);
  border-radius: 6px;
  font-size: 14px;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.role-nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.role-nav-desktop .role-nav-item:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.role-nav-desktop .role-nav-item.is-active {
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-weight: 650;
}

.role-nav-mobile {
  display: none;
}

.role-nav[hidden] {
  display: none !important;
}

.main-content {
  width: min(1120px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.view-heading h1 {
  margin: 0;
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.2;
  font-weight: 700;
}

.view-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 50px;
  margin-bottom: 24px;
  padding: 11px 14px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: var(--surface);
}

.status-band.is-warning {
  border-left-color: var(--amber);
}

.status-band.is-danger {
  border-left-color: var(--danger);
}

.status-band-copy {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
}

.is-warning .status-dot {
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}

.is-danger .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.status-band strong {
  color: var(--ink);
}

.parent-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 26px;
  align-items: start;
}

.schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(max-content, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eaf0ed;
}

.segmented button {
  appearance: none;
  min-height: 37px;
  padding: 0 15px;
  color: var(--muted);
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.segmented button.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(20, 42, 34, 0.1);
  font-weight: 650;
}

.availability-note {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.day-schedule {
  display: grid;
  gap: 30px;
}

.halfday-section {
  padding-top: 23px;
  border-top: 1px solid var(--line-strong);
}

.halfday-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.a-groups {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.a-group-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  color: var(--blue);
  border: 1px solid #d4e1ec;
  border-radius: 999px;
  background: var(--blue-soft);
  font-size: 11px;
  white-space: nowrap;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.slot-card {
  appearance: none;
  position: relative;
  min-height: 104px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 13px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.slot-card:hover:not(:disabled) {
  border-color: #8fc4b8;
  box-shadow: 0 8px 20px rgba(20, 94, 83, 0.09);
  transform: translateY(-1px);
}

.slot-card:active:not(:disabled) {
  transform: translateY(0);
}

.slot-card:disabled {
  cursor: default;
}

.slot-state {
  color: var(--teal);
  font-size: 11px;
  font-weight: 650;
}

.slot-time {
  align-self: center;
  font-size: 20px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

.slot-time span {
  margin: 0 3px;
  color: var(--muted);
  font-weight: 400;
}

.slot-meta {
  color: var(--muted);
  font-size: 11px;
}

.slot-card.is-booked {
  border-color: #e2e7e4;
  background: #f5f7f6;
}

.slot-card.is-booked .slot-state {
  color: var(--muted);
}

.slot-card.is-booked .slot-time {
  color: #87918d;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.closed-state,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 126px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}

.closed-state strong,
.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 14px;
}

.closed-state p,
.empty-state p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.booking-panel {
  position: sticky;
  top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 16px;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  color: var(--teal-dark);
  border-radius: 999px;
  background: var(--teal-soft);
  font-size: 11px;
  font-weight: 700;
}

.booking-ticket {
  padding: 14px;
  border: 1px solid #cfe1da;
  border-radius: 7px;
  background: var(--surface-soft);
}

.booking-ticket + .booking-ticket {
  margin-top: 10px;
}

.booking-ticket-kicker {
  margin-bottom: 7px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}

.booking-ticket strong {
  display: block;
  margin-bottom: 6px;
  font-size: 19px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.booking-ticket p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.booking-ticket .deadline {
  margin-top: 9px;
  color: var(--ink-soft);
}

.panel-empty {
  padding: 12px 4px 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.panel-note {
  margin: 13px 0 0;
  padding-top: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.6;
}

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.button:hover {
  background: var(--surface-soft);
  border-color: #aebfb7;
}

.button:disabled,
.choice-button:disabled,
.segmented button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button:disabled:hover,
.choice-button:disabled:hover {
  background: var(--surface);
  border-color: var(--line-strong);
}

.button svg {
  width: 16px;
  height: 16px;
}

.button-primary {
  color: #f7fffc;
  border-color: var(--teal);
  background: var(--teal);
}

.button-primary:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.button-danger {
  color: var(--danger);
  border-color: #ebc8c2;
  background: var(--danger-soft);
}

.button-danger:hover {
  border-color: #ddaaa2;
  background: #f6deda;
}

.button-quiet {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  font-weight: 500;
}

.button-quiet:hover {
  background: #eef3f0;
}

.button-block {
  width: 100%;
}

.button-small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.staff-stack {
  display: grid;
  min-width: 0;
  gap: 24px;
}

.staff-stack > *,
.admin-grid > * {
  min-width: 0;
}

.staff-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: stretch;
}

.summary-main {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.summary-kicker {
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}

.summary-main h2 {
  margin: 8px 0 6px;
  font-size: 24px;
  line-height: 1.3;
}

.summary-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.summary-aside {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.metric {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 17px;
  background: var(--surface);
}

.metric strong {
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
}

.staff-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.control-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.control-card.is-off {
  border-color: #ebcfca;
  background: #fffdfc;
}

.control-card.is-pending {
  border-color: #ead8be;
  background: #fffdf8;
}

.control-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.control-header h3 {
  margin: 0;
  font-size: 15px;
}

.control-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.status-chip.is-working {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.status-chip.is-off {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-chip.is-pending {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-chip.is-done {
  color: var(--blue);
  background: var(--blue-soft);
}

.master-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.master-tab {
  appearance: none;
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
}

.master-tab.is-active {
  color: var(--teal-dark);
  border-color: #9acbc0;
  background: var(--teal-soft);
  font-weight: 650;
}

.choice-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.choice-button {
  appearance: none;
  min-height: 40px;
  min-width: 112px;
  padding: 0 14px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
}

.choice-button.is-active {
  color: var(--teal-dark);
  border-color: #80bdb1;
  background: var(--teal-soft);
  font-weight: 650;
}

.choice-button.is-danger.is-active {
  color: var(--danger);
  border-color: #daa69d;
  background: var(--danger-soft);
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.form-field select,
.form-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  font-size: 14px;
}

.form-field select:disabled,
.form-field input:disabled {
  color: var(--muted);
  background: #f0f4f2;
}

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

.slot-preview {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.preview-time {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 8px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.admin-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-period {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-period.is-blocked {
  background: #fffafa;
}

.admin-period-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-period-header h3 {
  margin: 0;
  font-size: 16px;
}

.admin-period-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

.subheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.subheading h3 {
  margin: 0;
  font-size: 15px;
}

.subheading span {
  color: var(--muted);
  font-size: 11px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.booking-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12px;
}

.booking-table th,
.booking-table td {
  padding: 12px 13px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.booking-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 650;
}

.booking-table tr:last-child td {
  border-bottom: 0;
}

.booking-table tbody tr:hover {
  background: #fbfdfc;
}

.table-time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-actions {
  text-align: right;
}

.announcement-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.announcement-box pre {
  margin: 0;
  overflow: auto;
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 28, 24, 0.55);
  animation: fade-in 140ms ease-out;
}

.modal {
  width: min(440px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(9, 30, 23, 0.25);
  animation: modal-in 180ms ease-out;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
}

.modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.icon-button {
  appearance: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  background: #eef3f0;
}

.selected-slot {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #cfe1da;
  border-radius: 7px;
  background: var(--teal-soft);
}

.selected-slot strong {
  color: var(--teal-dark);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.selected-slot span {
  color: var(--ink-soft);
  font-size: 12px;
}

.modal-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.danger-copy {
  color: var(--danger);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 70;
  max-width: calc(100vw - 40px);
  padding: 11px 16px;
  color: #f8fffc;
  border-radius: 6px;
  background: #1b332c;
  box-shadow: 0 10px 30px rgba(15, 38, 29, 0.2);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: #73372f;
}

.mobile-only {
  display: none;
}

.readonly-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  margin-bottom: 20px;
  padding: 10px 13px;
  color: var(--amber);
  border: 1px solid #ecd7b9;
  border-radius: var(--radius);
  background: var(--amber-soft);
  font-size: 12px;
  line-height: 1.5;
}

.readonly-band strong {
  color: #7d4d14;
}

.parent-layout.is-readonly {
  grid-template-columns: minmax(0, 1fr);
}

.access-main {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 34px 20px 80px;
}

.access-heading {
  margin-bottom: 30px;
}

.access-heading h1 {
  margin: 0;
  font-size: clamp(27px, 3vw, 34px);
  line-height: 1.25;
}

.access-heading p {
  max-width: 680px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.access-section + .access-section {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line-strong);
}

.access-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.access-section-heading h2 {
  margin: 0;
  font-size: 17px;
}

.access-section-heading span {
  color: var(--muted);
  font-size: 11px;
}

.access-role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.access-role-card {
  min-height: 94px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.access-role-card:hover {
  border-color: #9bc8bd;
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.access-role-card strong,
.access-role-card small {
  display: block;
}

.access-role-card strong {
  font-size: 14px;
}

.access-role-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.access-role-primary {
  min-height: 104px;
  border-color: #b8d8d0;
}

.access-role-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--teal-dark);
  border-radius: 50%;
  background: var(--teal-soft);
  font-size: 13px;
  font-weight: 700;
}

.access-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 20px;
}

.access-note {
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.auth-shell {
  min-height: calc(100vh - var(--header-height) - 92px);
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.auth-panel {
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  margin: 9px 0 7px;
  font-size: 25px;
  line-height: 1.3;
}

.auth-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.form-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 12px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
}

@media (max-width: 900px) {
  .role-nav-desktop {
    display: none;
  }

  .role-nav-mobile {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
  }

  .role-nav-mobile .role-nav-item {
    display: grid;
    place-items: center;
    gap: 3px;
    min-height: 48px;
    color: #7a8681;
    border-radius: 6px;
    font-size: 10px;
  }

  .role-nav-mobile .role-nav-item.is-active {
    color: var(--teal-dark);
    background: var(--teal-soft);
    font-weight: 650;
  }

  .main-content {
    padding: 22px 16px calc(86px + env(safe-area-inset-bottom));
  }

  .parent-layout,
  .staff-summary {
    grid-template-columns: 1fr;
  }

  .booking-panel {
    position: static;
    grid-row: 1;
  }

  .staff-controls,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .access-role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 64px;
    padding: 10px 14px;
  }

  .brand-mark {
    width: 35px;
    height: 35px;
  }

  .brand-copy strong {
    font-size: 15px;
    white-space: nowrap;
  }

  .brand-copy small {
    display: none;
  }

  .trial-pill {
    display: inline-flex;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .weekend-pill {
    min-height: 28px;
    padding: 0 9px;
    font-size: 10px;
  }

  .site-header {
    gap: 8px;
  }

  .header-meta {
    gap: 5px;
  }

  .view-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
  }

  .view-heading h1 {
    font-size: 24px;
  }

  .heading-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .schedule-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    width: 100%;
    padding: 0 10px;
  }

  .availability-note {
    text-align: right;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .a-groups {
    justify-content: flex-start;
  }

  .slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .slot-card {
    min-height: 98px;
    padding: 11px;
  }

  .slot-time {
    font-size: 17px;
  }

  .staff-summary {
    gap: 12px;
  }

  .summary-main {
    padding: 18px;
  }

  .summary-main h2 {
    font-size: 21px;
  }

  .metric {
    min-height: 92px;
    padding: 13px;
  }

  .metric strong {
    font-size: 21px;
  }

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

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 88vh;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border-radius: 12px 12px 0 0;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .modal-actions .button {
    width: 100%;
  }

  .toast {
    bottom: 82px;
  }

  .role-parent .main-content {
    padding-bottom: 40px;
  }

  .role-parent .toast {
    bottom: 28px;
  }

  .readonly-band {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .access-main {
    padding: 25px 16px 56px;
  }

  .access-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .auth-shell {
    min-height: calc(100vh - 130px);
    padding: 12px 0 28px;
  }

  .auth-panel {
    padding: 22px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
