#planning-calendar { --pc-border: #dce3ec; --pc-blue: #1c5c9b; --pc-sand: #8b5b17; }
.pc-actions,.pc-range-actions,.pc-toolbar,.pc-mode { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-actions { margin-bottom: 14px; }
.pc-toolbar { justify-content: space-between; margin: 18px 0 10px; }
.pc-toolbar h2 { margin: 0; font-size: 20px; text-transform: capitalize; }
.pc-mode { margin-left: 8px; gap: 3px; }
.pc-guide { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 14px; margin-top: 12px; border-radius: 10px; background: #f4f7fb; font-size: 12px; line-height: 1.5; color: #556476; }
.pc-legend-deadline { color: var(--pc-blue); font-weight: 700; }
.pc-legend-control { color: var(--pc-sand); font-weight: 700; }
.pc-summary { color: #536276; font-size: 12px; margin: 10px 0; line-height: 1.6; }
.pc-summary strong { color: #273849; }
.pc-scroll { overflow-x: auto; border: 1px solid var(--pc-border); border-radius: 12px; background: #fff; }
.pc-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); min-width: 980px; }
.pc-weekday { background: #f3f6fa; text-align: center; font-weight: 700; color: #56667b; padding: 10px 4px; font-size: 12px; border-right: 1px solid var(--pc-border); }
.pc-weekday:nth-child(7) { border-right: 0; }
.pc-day { min-height: 148px; border-right: 1px solid var(--pc-border); border-top: 1px solid var(--pc-border); padding: 6px; background: #fff; transition: background 120ms ease; min-width: 0; }
.pc-day:nth-child(7n) { border-right: 0; }
.pc-weekend { background: #f9fafc; }
.pc-outside { background: #f3f5f8; }
.pc-outside .pc-day-number { color: #758193; }
.pc-today { box-shadow: inset 0 3px #1c5c9b; background: #f7fbff; }
.pc-day-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 6px; min-height: 25px; }
.pc-day-number { color: #31445a; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pc-day-long { display: none; }
.pc-today-label { color: #1c5c9b; font-size: 10px; font-weight: 600; }
.pc-day-create,.pc-date-edit,.pc-drag { border: 0; background: transparent; color: #52667b; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 25px; padding: 0 4px; border-radius: 5px; font: inherit; }
.pc-day-create { font-size: 20px; cursor: pointer; }
.pc-day-create:hover,.pc-date-edit:hover,.pc-drag:hover { background: #dce7f3; color: #123c63; }
.pc-drag { cursor: grab; font-size: 18px; user-select: none; }
.pc-drag:active { cursor: grabbing; }
.pc-date-edit { cursor: pointer; font-size: 16px; }
.pc-events { display: flex; flex-direction: column; gap: 7px; }
.pc-event { border-radius: 7px; border: 1px solid #c7dcee; border-left: 3px solid #286da9; background: #edf5fc; padding: 5px 6px 7px; min-width: 0; color: #163f67; }
.pc-control { background: #fff7e7; border-color: #eddbaf; border-left-color: #bc811e; color: #795013; }
.pc-event-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.pc-kind { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .035em; }
.pc-event-tools { display: flex; align-items: center; gap: 1px; flex-shrink: 0; }
.pc-task-title { color: inherit; font: inherit; font-size: 12px; line-height: 1.45; font-weight: 650; text-align: left; background: transparent; border: 0; padding: 2px 0 4px; width: 100%; cursor: pointer; overflow-wrap: anywhere; }
.pc-task-title:hover { text-decoration: underline; }
.pc-project,.pc-owner,.pc-event-status { display: block; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.pc-project { color: #526578; }
.pc-owner { color: #334d66; margin-top: 3px; }
.pc-event-status { margin-top: 4px; font-weight: 600; }
.pc-readonly { font-size: 10px; color: #68778a; line-height: 1.4; }
.pc-overdue { border-left-color: #b53636; }
.pc-overdue .pc-event-status { color: #a72c2c; }
.pc-risk:not(.pc-overdue) { border-right: 3px solid #c5891e; }
.pc-done { background: #edf7f1; border-color: #c9e5d5; border-left-color: #357b58; color: #245b42; }
.pc-archived { background: #eff1f4; border-color: #d5dce5; border-left-color: #8794a5; color: #556276; }
.pc-dragging { opacity: .45; }
.pc-drop-target { background: #dcecfb; box-shadow: inset 0 0 0 2px #286da9; }
.pc-no-events { color: #7a8798; font-size: 11px; padding: 8px 2px; }
.pc-help { font-size: 12px; color: #5d6d80; line-height: 1.6; margin-top: 15px; }
.pc-outside-events { margin: 12px 0 16px; background: #f5f7fa; border-radius: 8px; padding: 10px 12px; font-size: 12px; }
.pc-outside-events summary { cursor: pointer; color: #435970; font-weight: 600; }
.pc-outside-list { margin-top: 8px; max-height: 260px; overflow-y: auto; }
.pc-outside-row { display: grid; grid-template-columns: 140px 65px minmax(0,1fr); gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid #e2e8f0; }
.pc-outside-row button { text-align: left; }
.pc-unscheduled { margin-top: 18px; }
.pc-unscheduled .panel-head { padding-bottom: 12px; }
.pc-unscheduled .panel-head h2 { font-size: 16px; margin-bottom: 6px; }
.pc-unscheduled .panel-head p { font-size: 12px; }
.pc-unscheduled-list { display: flex; flex-direction: column; }
.pc-unscheduled-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid #e4e9f0; }
.pc-unscheduled-row > div { min-width: 0; }
.pc-unscheduled-row .task-link { overflow-wrap: anywhere; }
.pc-unscheduled-row .meta { font-size: 11px; margin-top: 4px; }
.pc-unscheduled-row > .btn { flex-shrink: 0; }
#planning-calendar button:focus-visible { outline: 2px solid #266da8; outline-offset: 2px; }
@media (min-width: 1500px) { .pc-grid { min-width: 1120px; } .pc-task-title { font-size: 13px; } }
@media (max-width: 700px) {
  .pc-toolbar { align-items: flex-start; }
  .pc-toolbar h2 { font-size: 18px; }
  .pc-range-actions { gap: 4px; }
  .pc-mode { margin-left: 3px; }
  .pc-guide { padding: 10px; gap: 8px 12px; }
  .pc-grid.is-week { min-width: 0; grid-template-columns: minmax(0,1fr); }
  .pc-grid.is-week .pc-weekday { display: none; }
  .pc-grid.is-week .pc-day { min-height: 95px; border-right: 0; padding: 10px; }
  .pc-grid.is-week .pc-day-long { display: inline; }
  .pc-grid.is-week .pc-event { padding: 8px 10px; }
  .pc-grid.is-week .pc-task-title { font-size: 13px; }
  .pc-grid.is-week .pc-owner,.pc-grid.is-week .pc-project,.pc-grid.is-week .pc-event-status { font-size: 11px; }
  .pc-unscheduled-row { flex-wrap: wrap; padding: 12px; }
  .pc-outside-row { grid-template-columns: 110px minmax(0,1fr); gap: 5px; }
  .pc-outside-row > button:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .pc-day { transition: none; } }

/* Whole-card drag and quarter: one continuous Monday-first grid, no duplicate dates. */
.pc-event[draggable=true]{cursor:grab}.pc-event[draggable=true]:active{cursor:grabbing}
.pc-event[draggable=true] .pc-task-title{user-select:none;-webkit-user-drag:none}
.pc-scroll:has(.is-quarter){max-height:72vh;overflow:auto}
.pc-grid.is-quarter .pc-weekday{position:sticky;top:0;z-index:2}
.pc-grid.is-quarter .pc-day{min-height:105px}
.pc-month-label{font-size:11px;color:#51667e;font-weight:500}
.pc-grid.is-quarter .pc-task-title{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
