:root {
  --ink: #24262b;
  --muted: #6f7580;
  --line: #e7dfd3;
  --paper: #fffdf8;
  --wash: #f7f1e8;
  --soft: #fbf6ed;
  --green: #23815a;
  --green-dark: #176846;
  --orange: #ee7d3e;
  --blue: #559bc7;
  --amber: #c98a1c;
  --red: #b84d46;
  --shadow: 0 18px 48px rgba(39, 34, 27, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.file-button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

button:focus-visible,
.file-button:focus-within,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(35, 129, 90, 0.22);
  outline-offset: 2px;
}

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

.is-hidden {
  display: none !important;
}

.primary-button {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
  padding: 0 16px;
}

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

.ghost-button,
.file-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  padding: 0 14px;
}

.danger-button {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  padding: 0 14px;
}

.full {
  width: 100%;
}

.start-panel {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  align-items: center;
  gap: clamp(26px, 5vw, 68px);
  padding: clamp(26px, 6vw, 72px);
  background:
    radial-gradient(circle at 18% 20%, rgba(238, 125, 62, 0.2), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(85, 155, 199, 0.18), transparent 28%),
    linear-gradient(120deg, rgba(255, 253, 248, 0.98) 0%, rgba(255, 253, 248, 0.94) 50%, rgba(247, 241, 232, 0.82) 100%),
    url("./assets/dance-rehearsal-room.png") center / cover no-repeat;
  background-blend-mode: normal, normal, normal, multiply;
}

.start-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 9% 16%, rgba(238, 125, 62, 0.16), transparent 9%),
    radial-gradient(circle at 92% 75%, rgba(35, 129, 90, 0.14), transparent 11%),
    linear-gradient(135deg, transparent 0 48%, rgba(255, 255, 255, 0.24) 48% 52%, transparent 52% 100%);
  mix-blend-mode: multiply;
  opacity: 0.8;
  pointer-events: none;
}

.start-panel > * {
  position: relative;
  z-index: 1;
}

.start-main {
  max-width: 520px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  line-height: 1.16;
  letter-spacing: 0;
}

.section-heading h1 {
  font-size: clamp(2.35rem, 7vw, 4.6rem);
}

.section-heading h2 {
  font-size: 1.12rem;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.eyebrow {
  display: block;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.app-mark,
.planner-mark {
  display: block;
  background: url("./assets/app-icon-transparent.png") center / contain no-repeat;
}

.home-mark-button {
  padding: 0;
  border: 0;
  background-color: transparent;
}

.home-mark-button:hover {
  transform: translateY(-1px);
}

.app-mark {
  width: 82px;
  height: 82px;
  margin-bottom: 16px;
  filter: drop-shadow(0 12px 18px rgba(238, 125, 62, 0.22));
}

.start-copy {
  max-width: 460px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.8;
}

.start-actions {
  display: grid;
  gap: 14px;
  margin-top: 34px;
}

.start-group {
  display: grid;
  gap: 8px;
}

.start-card {
  min-height: 116px;
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  width: 100%;
  padding: 22px 24px 22px 132px;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(255, 253, 248, 0.94), rgba(255, 253, 248, 0.98)),
    radial-gradient(circle at 96% 20%, rgba(238, 125, 62, 0.16), transparent 28%);
  border: 1px solid rgba(231, 223, 211, 0.92);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(39, 34, 27, 0.1);
  text-align: left;
  white-space: normal;
}

.start-card::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 72px;
  height: 72px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fff url("./assets/app-icon-transparent.png") center / 60% auto no-repeat;
  border: 1px solid var(--line);
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.66),
    0 10px 18px rgba(39, 34, 27, 0.1);
}

.start-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -34px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  opacity: 0.18;
  pointer-events: none;
}

.leader-card {
  border-left: 5px solid var(--orange);
}

.leader-card::after {
  background: var(--orange);
}

.member-card-entry {
  border-left: 5px solid var(--blue);
}

.member-card-entry::after {
  background: var(--blue);
}

.card-icon {
  display: none;
}

.start-card:hover {
  border-color: rgba(35, 129, 90, 0.42);
  background: #fff;
  transform: translateY(-1px);
}

.start-card strong {
  display: block;
  font-size: 1.34rem;
}

.start-card span {
  color: var(--muted);
  line-height: 1.55;
  font-weight: 500;
}

.start-inline-action {
  justify-self: start;
  min-height: 32px;
  padding: 0;
  color: var(--green-dark);
  background: transparent;
  border: 0;
  font-size: 0.9rem;
  font-weight: 900;
}

.start-art {
  min-height: 560px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.08), rgba(255, 253, 248, 0.16)),
    url("./assets/dance-rehearsal-room.png") center / cover no-repeat;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 253, 248, 0.68);
  mix-blend-mode: multiply;
}

.planner-view {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 54px;
}

.planner-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.planner-head > div:first-child {
  position: relative;
  min-height: 68px;
  padding-left: 82px;
}

.planner-mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 66px;
  height: 58px;
}

.planner-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.planner-actions {
  display: flex;
  gap: 8px;
}

.planner-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(39, 34, 27, 0.06);
}

.tab-button {
  min-height: 34px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  padding: 0 12px;
}

.tab-button.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

body[data-role="member"] #editEventButton,
body[data-role="member"] #slotForm,
body[data-role="member"] [data-action="delete-slot"],
body[data-role="member"] [data-action="delete-member"] {
  display: none !important;
}

.setup-grid,
.schedule-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.event-panel,
.side-stack,
.summary-panel,
.board-panel {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(39, 34, 27, 0.08);
}

.event-panel,
.side-stack,
.summary-panel,
.board-panel {
  padding: 18px;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.share-card {
  position: relative;
  overflow: hidden;
}

.share-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.08;
  pointer-events: none;
}

.event-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.event-summary-item {
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.event-summary-item:first-child {
  grid-column: 1 / -1;
}

.event-summary-item span,
.event-summary-item strong {
  display: block;
}

.event-summary-item span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.event-summary-item strong {
  overflow-wrap: anywhere;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.quick-actions .ghost-button {
  min-height: 34px;
  padding: 0 12px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

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

.field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.slot-manager {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.slot-manager-main {
  margin-top: 18px;
  padding-top: 16px;
}

.slot-manager-summary {
  color: var(--ink);
  font-weight: 900;
  margin-bottom: 8px;
}

.slot-manager-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.slot-manager-list {
  display: grid;
  gap: 8px;
}

.slot-manager-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.slot-manager-item strong,
.slot-manager-item span {
  display: block;
}

.slot-manager-item span {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.schedule-submit-area {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.submit-response-button {
  min-width: 180px;
}

.member-entry-card {
  display: none;
  gap: 12px;
}

body[data-role="member"] .member-entry-card {
  display: grid;
}

.member-identity {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #eef7f1;
  border: 1px solid rgba(35, 129, 90, 0.22);
  border-radius: var(--radius);
}

.member-identity span,
.member-identity strong {
  display: block;
}

.member-identity span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.member-identity strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.member-picker {
  display: grid;
  gap: 10px;
}

.member-picker-label,
.member-picker-empty {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.member-picker-empty {
  margin: 0;
  padding: 12px;
  background: #f7f3eb;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.member-picker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 190px;
  overflow: auto;
}

.member-choice-button {
  justify-content: flex-start;
  min-width: 0;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-choice-button[aria-pressed="true"] {
  color: var(--green-dark);
  background: #eef7f1;
  border-color: rgba(35, 129, 90, 0.34);
}

.member-dialog-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.member-dialog-divider::before,
.member-dialog-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

body[data-role="member"][data-section="schedule"] #topSyncButton {
  display: none;
}

body[data-role="member"] .quick-actions {
  display: none;
}

.inline-fields,
.button-row,
.button-grid {
  display: grid;
  gap: 8px;
}

.inline-fields,
.button-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.file-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.cloud-status {
  min-height: 42px;
  margin: 10px 0 0;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.code-display {
  min-height: 48px;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  background: #eef7f1;
  border: 1px dashed rgba(35, 129, 90, 0.42);
  border-radius: var(--radius);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.cloud-status.ready {
  color: var(--green-dark);
  background: #eef7f1;
  border-color: rgba(35, 129, 90, 0.24);
}

.cloud-status.error {
  color: var(--red);
  background: #fff2ef;
  border-color: rgba(184, 77, 70, 0.26);
}

.summary-meta {
  color: var(--muted);
  line-height: 1.55;
}

.candidate-calendar-mount {
  display: grid;
  gap: 8px;
}

.candidate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.candidate-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.candidate-overview-item {
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.candidate-overview-item span,
.candidate-overview-item strong {
  display: block;
}

.candidate-overview-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.candidate-overview-item strong {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.summary-meta {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

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

.compact-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.86rem;
  white-space: nowrap;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.legend span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.yes {
  color: var(--green);
}

.maybe {
  color: var(--amber);
}

.no {
  color: var(--red);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.member-name {
  display: block;
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.member-role,
.slot-note,
.slot-meta {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.slot-title {
  display: block;
  min-width: 110px;
  color: var(--ink);
  font-weight: 900;
}

.slot-actions,
.member-actions {
  display: flex;
  gap: 7px;
  margin-top: 7px;
}

.mini-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 0.78rem;
  color: var(--muted);
  background: #fff;
  border-color: var(--line);
}

.mobile-board {
  display: none;
}



.calendar-wrap {
  display: grid;
  gap: 12px;
}

.calendar-month {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.calendar-month-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-weight: 900;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.calendar-month-title > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-month-count {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: var(--green-dark);
  background: #eef7f1;
  border: 1px solid rgba(35, 129, 90, 0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.calendar-month-nav {
  display: inline-grid;
  grid-template-columns: repeat(2, 30px);
  gap: 6px;
}

.calendar-month-nav-button {
  min-height: 30px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  font-size: 0.95rem;
}

.calendar-month-nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 12px;
}

.calendar-weekday {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.calendar-day {
  min-width: 0;
  min-height: 82px;
  display: grid;
  align-content: space-between;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 900;
}

.calendar-day.is-outside {
  opacity: 0;
  pointer-events: none;
}

.calendar-day.is-yes,
.calendar-day.is-available {
  background: #f2faf5;
  border-color: rgba(35, 129, 90, 0.28);
}

.calendar-day.is-maybe,
.calendar-day.is-partial {
  background: #fff8e6;
  border-color: rgba(201, 138, 28, 0.36);
}

.calendar-day.is-no,
.calendar-day.is-unavailable,
.calendar-day.is-blocked {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.calendar-day-toggle {
  min-width: 0;
  min-height: 28px;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font-size: 1rem;
}

.calendar-day-status {
  min-width: 0;
  width: 100%;
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.is-no .calendar-day-status,
.is-unavailable .calendar-day-status,
.is-blocked .calendar-day-status {
  color: rgba(255, 255, 255, 0.9);
}

.calendar-day-ranges {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  min-height: 24px;
  padding: 0 4px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(231, 223, 211, 0.8);
  font-size: 0.72rem;
  gap: 0;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.calendar-day-ranges:disabled {
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.candidate-day {
  width: 100%;
  color: var(--ink);
  white-space: normal;
}

.candidate-day strong {
  display: block;
  text-align: center;
}

.candidate-day.is-available {
  color: #0f4f35;
}

.candidate-day.is-partial {
  color: #614207;
}

.calendar-dots {
  min-height: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
}

.calendar-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.range-list {
  display: grid;
  gap: 10px;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.day-detail-list {
  display: grid;
  gap: 8px;
}

.day-detail-group {
  display: grid;
  gap: 8px;
}

.day-detail-group h3 {
  margin: 8px 0 0;
  font-size: 0.95rem;
}

.day-detail-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.day-detail-item span {
  color: var(--muted);
  line-height: 1.5;
}

.schedule-accordion {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.member-schedule-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.member-schedule-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.member-schedule-summary > span:first-child {
  min-width: 0;
}

.member-schedule-summary::-webkit-details-marker {
  display: none;
}

.member-schedule-summary::after {
  content: "展开";
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.member-schedule-card[open] .member-schedule-summary::after {
  content: "收起";
}

.member-total {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0 9px;
  color: var(--green-dark);
  background: #eef7f1;
  border: 1px solid rgba(35, 129, 90, 0.22);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.member-schedule-body {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.advanced-panel {
  color: var(--muted);
}

.advanced-panel summary {
  cursor: pointer;
  font-weight: 800;
}

.advanced-actions {
  margin-top: 12px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
  padding: 22px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 40;
  max-width: min(92vw, 520px);
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  color: #fff;
  background: rgba(37, 40, 43, 0.94);
  border-radius: var(--radius);
  padding: 11px 14px;
  box-shadow: var(--shadow);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

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

.modal {
  width: min(440px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 0;
  box-shadow: 0 24px 80px rgba(37, 40, 43, 0.22);
}

.modal::backdrop {
  background: rgba(37, 40, 43, 0.42);
}

.modal-body {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 13px;
  padding: 20px;
}

.modal-body::before {
  content: "";
  width: 68px;
  height: 68px;
  display: block;
  background: url("./assets/app-icon-transparent.png") center / contain no-repeat;
  filter: drop-shadow(0 8px 12px rgba(39, 34, 27, 0.12));
}

.range-dialog-help {
  margin: -4px 0 2px;
  padding: 12px;
  color: var(--ink);
  background: #fff8e6;
  border: 1px solid rgba(201, 138, 28, 0.26);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.55;
}

.create-modal-body::after,
.join-modal-body::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -42px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  opacity: 0.1;
  pointer-events: none;
}

.create-modal-body::after {
  background: var(--orange);
}

.join-modal-body::after {
  background: var(--blue);
}

.image-export-modal {
  width: min(760px, calc(100% - 24px));
}

.image-export-body {
  max-height: min(86vh, 820px);
  overflow: auto;
}

.export-preview-image {
  display: block;
  width: 100%;
  max-height: 56vh;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-user-select: auto;
  user-select: auto;
  -webkit-touch-callout: default;
}

@media (max-width: 1080px) {
  .start-panel {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .start-main {
    max-width: 720px;
  }

  .start-art {
    min-height: 360px;
  }

  .setup-grid,
  .schedule-grid {
    grid-template-columns: 1fr;
  }

  body[data-role="member"] .schedule-grid .side-stack {
    order: -1;
  }

  body[data-role="member"] .schedule-grid .advanced-panel {
    display: none;
  }

  .candidate-overview {
    grid-template-columns: 1fr;
  }

  body[data-role="member"] .schedule-submit-area {
    position: sticky;
    bottom: 10px;
    z-index: 20;
    padding: 8px;
    background: rgba(255, 250, 242, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(37, 40, 43, 0.12);
  }

  body[data-role="member"] .submit-response-button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .start-panel {
    min-height: 100vh;
    align-content: stretch;
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 22px 14px 28px;
  }

  .start-main {
    width: 100%;
    max-width: 420px;
    align-self: center;
    justify-self: center;
  }

  .start-main .section-heading {
    text-align: center;
  }

  .app-mark {
    width: 66px;
    height: 66px;
    margin: 0 auto 12px;
  }

  .section-heading h1 {
    font-size: 2.15rem;
  }

  .start-copy {
    margin-inline: auto;
    font-size: 0.98rem;
  }

  .start-actions {
    max-width: 420px;
    margin-inline: auto;
  }

  .start-card {
    min-height: 106px;
    padding: 18px 18px 18px 104px;
  }

  .start-card::before {
    left: 18px;
    width: 64px;
    height: 64px;
  }

  .start-card strong {
    font-size: 1.18rem;
  }

  .start-art {
    align-self: end;
    width: 100%;
    min-height: 230px;
  }

  .planner-view {
    width: min(100% - 20px, 640px);
    padding-top: 16px;
  }

  .planner-head {
    grid-template-columns: 1fr;
  }

  .planner-actions,
  .planner-tabs,
  .button-row,
  .inline-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

  .event-summary-item:first-child,
  .field.wide {
    grid-column: auto;
  }

  .board-header {
    display: grid;
  }

  .candidate-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .candidate-actions > button,
  .candidate-actions > .compact-button {
    width: 100%;
  }

  .legend {
    justify-content: flex-start;
  }

  .table-scroll {
    display: none;
  }

  .mobile-board {
    display: block;
  }

  .schedule-accordion,
  .member-schedule-card,
  .member-schedule-body,
  .calendar-wrap,
  .calendar-month {
    min-width: 0;
  }

  .member-schedule-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
  }

  .member-schedule-summary::after {
    justify-self: end;
  }

  .member-total {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .member-schedule-body {
    padding: 8px;
  }

  .calendar-grid {
    gap: 4px;
    padding: 8px;
  }

  .calendar-day {
    min-height: 72px;
    padding: 5px 3px;
  }

  .calendar-day-toggle {
    min-height: 24px;
    font-size: 0.92rem;
  }

  .calendar-day-status {
    font-size: 0.64rem;
    line-height: 1.15;
  }

  .calendar-day-ranges {
    min-height: 22px;
    padding: 0 2px;
    font-size: 0.62rem;
  }

  .range-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .planner-actions,
  .planner-tabs,
  .button-row,
  .inline-fields {
    grid-template-columns: 1fr;
  }

  .member-picker-list {
    grid-template-columns: 1fr;
  }

  .calendar-month-title {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .calendar-month-count {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .calendar-grid {
    gap: 3px;
  }

  .calendar-day {
    min-height: 66px;
    padding: 4px 2px;
  }

  .calendar-day-toggle {
    min-height: 22px;
    font-size: 0.86rem;
  }

  .calendar-day-status {
    font-size: 0.58rem;
  }

  .calendar-day-ranges {
    min-height: 20px;
    font-size: 0.56rem;
  }
}
