.req {
  font-size: 0.8rem;
  color: var(--accent);
}

.checkbox-group {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.95rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  transition: background 150ms, border-color 150ms;
}

.checkbox-label:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  border-color: var(--accent);
}

.checkbox-label input {
  width: auto;
  accent-color: var(--accent);
}

.radio-group {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.95rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  transition: background 150ms, border-color 150ms;
}

.radio-label:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  border-color: var(--accent);
}

.radio-label input {
  width: auto;
  accent-color: var(--accent);
}

/* Toggle switch for 要靜 */
.toggle-row {
  margin-top: 0.7rem;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  user-select: none;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  transition: background 200ms, border-color 200ms, color 200ms;
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  background: #d0d3db;
  border-radius: 11px;
  transition: background 200ms;
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: left 200ms;
}

/* Checked state — red track + pill */
.toggle-label:has(input:checked) {
  background: #fde8e8;
  border-color: #c0392b;
  color: #7b1a1a;
}

.toggle-label:has(input:checked) .toggle-track {
  background: #c0392b;
}

.toggle-label:has(input:checked) .toggle-thumb {
  left: 21px;
}

  --ink: #1f1f22;
  --muted: #5b5d6b;
  --paper: #fff9ef;
  --card: rgba(255, 255, 255, 0.85);
  --accent: #f45b2e;
  --accent-dark: #b33617;
  --line: rgba(31, 31, 34, 0.14);
  --focus: #0d6fb9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 10%, #fddfbd 0%, #fff9ef 48%, #f8ece8 100%);
  color: var(--ink);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.ambient-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.34;
  pointer-events: none;
}

.ambient-shape-a {
  width: 260px;
  height: 260px;
  background: #f47652;
  top: -70px;
  right: -30px;
}

.ambient-shape-b {
  width: 320px;
  height: 320px;
  background: #4ba3c7;
  bottom: -120px;
  left: -110px;
}

.layout {
  width: min(1180px, 92vw);
  margin: 2.5rem auto;
  display: grid;
  grid-template-columns: 1.7fr 0.95fr;
  gap: 1.2rem;
  position: relative;
  z-index: 1;
}

.hero {
  grid-column: 1 / -1;
  animation: rise 600ms ease-out;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--muted);
}

h1 {
  margin: 0.28rem 0 0.35rem;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.06;
}

.subtitle {
  margin: 0;
  max-width: 64ch;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(5px);
  box-shadow: 0 12px 34px rgba(31, 31, 34, 0.1);
  animation: rise 700ms ease-out;
}

.calendar-card {
  padding: 1rem;
}

.form-card {
  padding: 1.2rem;
  align-self: start;
}

.form-card h2 {
  margin: 0 0 1rem;
  font-family: "Fraunces", serif;
}

label {
  display: block;
  margin: 0.7rem 0 0.35rem;
  font-size: 0.92rem;
  color: var(--muted);
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 10px;
  border: 1.5px solid #333;
  padding: 0.62rem 0.7rem;
  background: #ffffff;
  color: #333;
  cursor: pointer;
}

/* Make the entire date/time field area open the picker on click */
input[type="date"],
input[type="time"] {
  position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.time-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.time-row input[type="time"] {
  flex: 1;
}

.time-preset-btn {
  white-space: nowrap;
  padding: 0.62rem 0.8rem;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b5d6b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2rem;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 30%, transparent);
  outline-offset: 1px;
  border-color: var(--focus);
}

textarea {
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.actions[hidden] {
  display: none;
}

button {
  border: 1.5px solid #333;
  border-radius: 10px;
  padding: 0.6rem 0.95rem;
  color: #333;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary {
  background: linear-gradient(140deg, var(--accent) 0%, #ff8f4a 100%);
  color: #fff;
  border-color: #333;
}

.secondary {
  background: #eceff3;
  color: #333;
}

.danger {
  background: #f8d9d9;
  color: #6e1e1e;
}

.success {
  background: #d4f5e2;
  color: #1a5c35;
}

.info {
  background: #d4eaf5;
  color: #1a3d5c;
}

.status {
  min-height: 1.2em;
  margin-top: 0.95rem;
  color: var(--muted);
}

.fc .fc-toolbar-title {
  font-family: "Fraunces", serif;
}

.fc .fc-button-primary {
  background: #254d66;
  border-color: #254d66;
}

.fc .fc-button-primary:disabled {
  background: #7d92a0;
  border-color: #7d92a0;
}

.fc .fc-event {
  background: #f45b2e;
  border-color: #f45b2e;
  cursor: pointer;
}

/* ── Month view: taller rows so all three lines are visible ── */
.fc .fc-daygrid-day-frame {
  min-height: 90px;
}

.fc .fc-daygrid-event {
  white-space: normal !important;
}

/* ── Week/day view: slot height ── */
.fc .fc-timegrid-slot {
  height: 2.4em;
}

.fc-event-custom {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px 5px;
  line-height: 1.3;
  width: 100%;
  box-sizing: border-box;
}

.fc-event-time-range {
  font-size: 0.72rem;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-event-title-text {
  font-size: 0.84rem;
  font-weight: 600;
  white-space: normal;
  word-break: break-word;
}

.fc-event-user {
  font-size: 0.72rem;
  opacity: 0.88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-event-location {
  font-size: 0.72rem;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-event-flow-state {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 0.95;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .form-card {
    order: 3;
  }
}
