.calendar-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 20px;
  padding: 22px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(11, 7, 18, 0.92), rgba(18, 10, 27, 0.88));
  border: 1px solid rgba(255, 98, 176, 0.22);
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.2s ease;
}

.calendar-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 95, 173, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 95, 173, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
}

.calendar-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(78px);
  pointer-events: none;
  z-index: 0;
}

.glow-a {
  background: rgba(255, 55, 151, 0.34);
  top: -120px;
  left: -120px;
}

.glow-b {
  background: rgba(255, 130, 202, 0.24);
  bottom: -130px;
  right: -90px;
}

.calendar-top,
.calendar-panel,
.agenda-panel {
  position: relative;
  z-index: 1;
}

.calendar-fab {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 99;
  border: 1px solid rgba(255, 118, 189, 0.45);
  border-radius: 999px;
  background: linear-gradient(130deg, #ff4fa3, #ff2f94);
  color: #fff3fb;
  font-weight: 700;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(255, 69, 162, 0.3);
}

.calendar-fab.hidden {
  display: none !important;
}

.calendar-top {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 4px;
}

.calendar-eyebrow {
  margin: 0 0 4px;
  color: #ff9cd0;
  font-size: 12px;
  letter-spacing: 0.16em;
}

.calendar-top h1 {
  margin: 0;
  font-size: clamp(1.75rem, 2.9vw, 2.4rem);
  text-shadow: 0 0 20px rgba(255, 64, 156, 0.3);
}

.calendar-note {
  margin: 6px 0 0;
  color: #d8b8cc;
}

.calendar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cal-btn,
.month-btn {
  border: 1px solid rgba(255, 118, 189, 0.4);
  background: rgba(21, 13, 30, 0.9);
  color: #ffe2f2;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cal-btn:hover,
.month-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 69, 162, 0.24);
}

.cal-btn-owner {
  background: linear-gradient(130deg, #ff4fa3, #ff2f94);
  border-color: transparent;
}

.hidden {
  display: none !important;
}

.calendar-panel {
  padding: 16px;
  border-radius: 20px;
  background: rgba(10, 7, 16, 0.82);
  border: 1px solid rgba(255, 126, 194, 0.2);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
}

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

#month-title {
  margin: 0;
  font-size: 1.28rem;
}

.week-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
  color: #d6b2c8;
  font-size: 0.9rem;
}

.week-head span {
  text-align: center;
}

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

.day-cell {
  min-height: 108px;
  border-radius: 12px;
  border: 1px solid rgba(255, 124, 194, 0.17);
  background: rgba(22, 15, 31, 0.85);
  padding: 8px 7px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.day-cell:hover {
  border-color: rgba(255, 138, 203, 0.45);
  box-shadow: 0 10px 20px rgba(255, 76, 167, 0.18);
}

.day-cell.today {
  outline: 2px solid rgba(255, 95, 173, 0.78);
}

.day-cell.active {
  border-color: rgba(255, 130, 202, 0.86);
  box-shadow: 0 0 0 1px rgba(255, 130, 202, 0.55) inset;
}

.day-cell.other {
  opacity: 0.42;
}

.day-num {
  font-size: 0.86rem;
  color: #ffe3f3;
}

.day-markers {
  margin-top: 8px;
  display: grid;
  gap: 5px;
}

.marker {
  position: relative;
  display: block;
  border-radius: 8px;
  font-size: 0.72rem;
  line-height: 1.25;
  padding: 4px 6px 4px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f6f7ff;
}

.marker::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.68);
}

.marker.done {
  opacity: 0.76;
  text-decoration: line-through;
}

.agenda-panel {
  padding: 16px;
  border-radius: 20px;
  background: rgba(12, 9, 18, 0.84);
  border: 1px solid rgba(255, 126, 194, 0.2);
}

.agenda-panel h3 {
  margin-top: 0;
}

#agenda-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 16px;
  display: grid;
  gap: 10px;
}

.agenda-item {
  border-radius: 10px;
  border: 1px solid rgba(255, 140, 206, 0.24);
  background: rgba(26, 17, 36, 0.92);
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.agenda-item:hover {
  border-color: rgba(255, 140, 206, 0.5);
}

.agenda-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.agenda-check {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: #ff4fa3;
  cursor: pointer;
}

.agenda-time {
  color: #ffaad6;
  font-size: 0.82rem;
}

.agenda-title {
  color: #ffd5ec;
  font-weight: 700;
}

.agenda-desc {
  color: #e7c8dc;
  font-size: 0.9rem;
}

.agenda-item.done .agenda-title,
.agenda-item.done .agenda-desc,
.agenda-item.done .agenda-time {
  text-decoration: line-through;
  opacity: 0.75;
}

.agenda-empty {
  color: #d5b1c9;
}

dialog#edit-dialog {
  border: 1px solid rgba(255, 126, 194, 0.35);
  border-radius: 14px;
  background: #100a18;
  color: #ffe8f5;
  width: min(94vw, 520px);
  padding: 0;
}

#edit-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

#edit-form label {
  display: grid;
  gap: 6px;
  color: #d9b6ce;
}

#edit-form input {
  border: 1px solid rgba(255, 132, 201, 0.34);
  border-radius: 10px;
  background: rgba(34, 23, 46, 0.9);
  color: #ffe9f6;
  padding: 10px;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#item-color {
  width: 64px;
  height: 42px;
  padding: 4px;
  cursor: pointer;
}

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

.todo-toggle {
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: #ffe7f4 !important;
}

.todo-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #ff4fa3;
}

#edit-form menu {
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#edit-form button {
  border: 1px solid rgba(255, 132, 201, 0.4);
  border-radius: 9px;
  padding: 8px 12px;
  background: rgba(27, 18, 37, 0.9);
  color: #ffe8f5;
  cursor: pointer;
}

#edit-form button[type="submit"] {
  background: linear-gradient(120deg, #ff4fa3, #ff2f94);
  border-color: transparent;
}

#edit-form .danger {
  margin-right: auto;
  background: rgba(146, 35, 81, 0.5);
}

@media (max-width: 1080px) {
  .calendar-shell {
    grid-template-columns: 1fr;
    transform: none !important;
  }
}

@media (max-width: 760px) {
  .calendar-shell {
    padding: 14px;
  }

  .calendar-panel,
  .agenda-panel {
    padding: 12px;
    border-radius: 14px;
  }

  .day-cell {
    min-height: 90px;
  }

  .date-time-grid {
    grid-template-columns: 1fr;
  }

  .cal-btn,
  .month-btn {
    width: 100%;
  }

  .calendar-fab {
    right: 14px;
    bottom: 14px;
    padding: 10px 14px;
    font-size: 14px;
    width: auto !important;
  }
}
