:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f6f7fb; color: #19202a; }
* { box-sizing: border-box; }
body { margin: 0; }
.shell { width: min(1100px, calc(100vw - 32px)); margin: 32px auto; }
.card { background: #fff; border: 1px solid #e7e9f0; border-radius: 18px; padding: 24px; box-shadow: 0 10px 30px rgba(20, 30, 60, .06); }
.hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 20px; }
.eyebrow { color: #e91e63; font-weight: 700; letter-spacing: .08em; margin: 0 0 8px; }
h1 { margin: 0 0 10px; font-size: 32px; }
h2 { margin: 0 0 18px; font-size: 20px; }
p { line-height: 1.7; }
.meta { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 12px; min-width: 390px; }
.meta div { background: #f8f9fe; border-radius: 14px; padding: 14px; }
.meta span { display: block; color: #6b7280; font-size: 12px; margin-bottom: 6px; }
.meta strong { font-size: 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field span { font-weight: 700; font-size: 13px; }
input, textarea { width: 100%; border: 1px solid #d9deea; border-radius: 12px; padding: 12px 14px; font: inherit; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.slot, .primary { border: 0; border-radius: 12px; padding: 12px; font-weight: 700; cursor: pointer; }
.slot { background: #f3f5fb; color: #233044; border: 1px solid #e2e7f2; }
.slot.selected { background: #e91e63; color: white; border-color: #e91e63; }
.primary { width: 100%; background: #25314f; color: #fff; margin-top: 6px; }
.result { margin-top: 16px; padding: 16px; border-radius: 14px; border: 1px solid transparent; }
.result p { margin: 0 0 6px; }
.result p:last-child { margin-bottom: 0; }
.result.success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.result.error { background: #fff1f2; border-color: #fecaca; color: #9f1239; }
.result-title { font-weight: 700; font-size: 1.05rem; }
.result-when { font-size: 1.1rem; font-weight: 700; }
.result-note { font-size: 0.85rem; opacity: 0.85; }
.result a { color: inherit; word-break: break-all; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.empty, .hint { color: #6b7280; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.link-button, .link-primary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.link-button { color: #25314f; font-weight: 700; }
.link-primary { width: auto; min-width: 180px; }
.danger { border: 1px solid #fecaca; border-radius: 12px; padding: 12px 16px; background: #fff1f2; color: #be123c; font-weight: 700; cursor: pointer; }
.status-box { background: #f8f9fe; border-radius: 14px; padding: 16px; }
dl { margin: 0; display: grid; gap: 10px; }
dl div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e6e9f3; padding-bottom: 10px; }
dl div:last-child { border-bottom: 0; padding-bottom: 0; }
dt { color: #6b7280; font-weight: 700; }
dd { margin: 0; font-weight: 800; }
@media (max-width: 800px) { .hero, .grid { grid-template-columns: 1fr; display: grid; } .meta { min-width: 0; grid-template-columns: 1fr; } }

.shell.narrow { max-width: 640px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.invite-form {
  margin: 16px 0 24px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
}

.member-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.member {
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
}

.member-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.member-name { margin: 0; font-weight: 600; }
.member-email { margin: 2px 0 0; font-size: 0.85rem; opacity: 0.7; }

.role {
  margin-left: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.65;
}

.badge { font-size: 0.8rem; white-space: nowrap; }
.badge.ok { color: #16a34a; }
.badge.pending { color: #d97706; }

.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ghost {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  color: inherit;
}

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

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

fieldset.field {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

legend { font-size: 0.85rem; font-weight: 600; padding: 0 6px; }

.warn { margin: 6px 0 0; font-size: 0.8rem; color: #d97706; }
.warn-inline { font-size: 0.75rem; color: #d97706; }
.saved-note { font-size: 0.85rem; color: #16a34a; align-self: center; }

code {
  background: rgba(148, 163, 184, 0.18);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.85em;
}

/* --- 週表示カレンダー --- */
.week-layout { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }

.week-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-label { font-weight: 700; min-width: 92px; text-align: center; }

.calendar { margin-top: 12px; overflow-x: auto; }
.cal-grid { min-width: 640px; }

.cal-row { display: grid; grid-template-columns: 56px repeat(7, minmax(76px, 1fr)); }
.cal-row + .cal-row .cal-cell { border-top: 1px solid #eef0f7; }

.cal-header { position: sticky; top: 0; background: #fff; z-index: 1; }
.cal-day-head { padding: 8px 4px; text-align: center; border-bottom: 2px solid #e6e9f3; }
.cal-day-head.today { border-bottom-color: #4f46e5; }
.cal-day-head.sat .cal-dow { color: #2563eb; }
.cal-day-head.sun .cal-dow { color: #dc2626; }
.cal-dow { display: block; font-size: 0.72rem; opacity: 0.75; }
.cal-date { display: block; font-size: 0.95rem; font-weight: 700; }

.cal-hour { padding: 6px 8px 0 0; text-align: right; font-size: 0.72rem; color: #9aa1b5; }
.cal-cell { min-height: 44px; padding: 4px 3px; display: flex; flex-direction: column; gap: 3px; }

.chip {
  border: 1px solid #d6dbeb; background: #fff; border-radius: 8px;
  padding: 5px 2px; font-size: 0.78rem; font-weight: 600; color: #25314f;
  cursor: pointer; width: 100%;
}
.chip:hover { border-color: #4f46e5; background: #f5f5ff; }
.chip.selected { background: #4f46e5; border-color: #4f46e5; color: #fff; }

.selected-slot {
  margin: 0 0 16px; padding: 12px 14px; border-radius: 12px;
  background: #f8f9fe; color: #9aa1b5; font-weight: 600;
}
.selected-slot.has-value { background: #eef2ff; color: #312e81; }

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