/* Календар в планера (planner-calendar.js): месец (меки плочки с етикети), цялата година (12 месеца на 2 реда),
   денят под календара, „До сватбата“ и „Предстоящи“. Цветът на всеки вид е в --k (класовете plc-k-*). */
.plc-k-own {
  --k: var(--plc-color, var(--gold));
}
.plc-k-team {
  --k: var(--gold-deep, #6f5419);
}
.plc-k-task {
  --k: var(--sage, #7c9a86);
}
.plc-k-payment {
  --k: var(--rose, #c47a7a);
}
.plc-k-event {
  --k: var(--gold);
}
.plc-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--k, var(--gold));
}
.plc-k-team .plc-dot {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--k);
}

/* Широка страница за „Цялата година“ (body.plc-wide) */
body.plc-wide main.portal {
  max-width: 1440px;
  padding-left: clamp(16px, 3vw, 48px);
  padding-right: clamp(16px, 3vw, 48px);
}

/* ---------- Подредба ---------- */
.plc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
.plc-layout-year {
  grid-template-columns: 1fr;
}
#planner .plc-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px 28px 24px;
  border-radius: 22px;
}
#planner .pl-page-head .pl-actions .button,
#planner .pl-page-head .pl-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#planner .pl-page-head .pl-actions svg {
  width: 16px;
  height: 16px;
}

/* ---------- Лента: заглавие, стрелки, изглед ---------- */
.plc-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
}
#planner .plc-nav h2 {
  margin: 0 auto 0 0;
  font-family: 'Lora', Georgia, serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.1;
}
#planner .plc-nav h2 span {
  color: var(--ink-muted);
  font-weight: 400;
}
.plc-nav-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}
#planner .plc-arrow {
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
}
#planner .plc-today-btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 35px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
}
#planner .plc-arrow:hover,
#planner .plc-today-btn:hover {
  border-color: var(--gold-line, var(--line-strong));
  background: var(--paper-sunk);
}
#planner .plc-views {
  margin: 0;
}
#planner .plc-views button {
  min-height: 34px;
  padding: 4px 16px;
}

/* ---------- Месец: меки плочки ---------- */
.plc-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.plc-dow {
  padding: 0 0 4px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-align: center;
}
.plc-dow.plc-weekend {
  color: var(--gold);
}
.plc-day {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 112px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #faf9f7;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
.plc-day.plc-weekend {
  background: #f6f2ec;
}
.plc-day:hover {
  border-color: var(--line);
  background: #fff;
}
.plc-day.plc-out {
  background: transparent;
}
.plc-out .plc-num,
.plc-out .plc-items {
  opacity: 0.45;
}
#planner .plc-num {
  display: grid;
  place-items: center;
  align-self: flex-start;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
#planner .plc-num:hover {
  background: var(--gold-soft);
}
.plc-day.plc-today {
  border-color: var(--gold-line, var(--gold));
  background: #fff;
}
#planner .plc-today .plc-num {
  background: var(--gold);
  color: #fff;
}
.plc-day.plc-selected {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px var(--gold-soft);
}
/* денят на събитието — златиста плочка */
.plc-day.plc-wedding {
  border-color: var(--gold);
  background: linear-gradient(160deg, #fdf6e7, #f3e2bd);
}
.plc-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
#planner .plc-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 4px 7px;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  box-shadow: 0 1px 2px rgba(41, 39, 37, 0.07);
  cursor: pointer;
}
#planner .plc-chip:hover {
  box-shadow:
    0 1px 2px rgba(41, 39, 37, 0.07),
    inset 0 0 0 1px var(--k, var(--gold));
}
#planner .plc-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#planner .plc-today .plc-chip,
#planner .plc-selected .plc-chip,
#planner .plc-day:hover .plc-chip {
  background: var(--paper-sunk);
  box-shadow: none;
}
#planner .plc-chip.plc-k-team {
  font-weight: 600;
}
#planner .plc-chip.plc-k-event {
  background: var(--gold);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}
#planner .plc-chip.plc-k-event svg {
  flex: none;
  width: 12px;
  height: 12px;
  fill: currentColor;
}
#planner .plc-chip.plc-done > span {
  text-decoration: line-through;
  opacity: 0.6;
}
#planner .plc-sum {
  font-weight: 600;
}
#planner .plc-more {
  align-self: flex-start;
  min-height: 0;
  padding: 1px 8px;
  border: 0;
  border-radius: 35px;
  background: transparent;
  color: var(--gold-ink);
  font-size: 11px;
  font-weight: 700;
}
#planner .plc-more:hover {
  background: var(--gold-soft);
}

/* ---------- Легенда ---------- */
.plc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--ink-muted);
  font-size: 12.5px;
}
.plc-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* ---------- Избраният ден ---------- */
.plc-daypanel {
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--paper-sunk);
}
.plc-daypanel-hint {
  margin: 0;
  padding: 12px 16px;
  border: 1px dashed var(--line);
  background: none;
  color: var(--ink-muted);
  font-size: 13px;
  text-align: center;
}
.plc-daypanel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
#planner .plc-daypanel h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 500;
}
#planner .plc-daypanel-head button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}
#planner .plc-daypanel-head svg {
  width: 15px;
  height: 15px;
}
.plc-daylist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.plc-daylist li {
  display: grid;
  grid-template-columns: 8px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #fff;
}
.plc-daylist time {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
}
#planner .plc-row-title {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
#planner .plc-row-title:hover {
  color: var(--gold-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.plc-daylist small {
  color: var(--ink-muted);
  font-size: 12px;
  text-align: right;
}
.plc-daylist .plc-done .plc-row-title {
  text-decoration: line-through;
  opacity: 0.6;
}
.plc-daylist .plc-k-event {
  background: linear-gradient(160deg, #fdf6e7, #f3e2bd);
}
.plc-empty {
  margin: 0;
  color: var(--ink-muted);
}

/* ---------- Отстрани: „До сватбата“ и „Предстоящи“ ---------- */
.plc-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.plc-count {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 24px 24px;
  border: 1px solid var(--gold-line, #e2cf9f);
  border-radius: 22px;
  background: linear-gradient(150deg, #fdf8ee 0%, #f5e6c4 100%);
  color: var(--ink);
}
.plc-count > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.plc-count svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
  fill: currentColor;
}
.plc-count strong {
  font-family: 'Lora', Georgia, serif;
  font-size: 58px;
  font-weight: 400;
  line-height: 1;
  color: var(--gold-deep, #6f5419);
}
#planner .plc-count small {
  color: var(--ink-muted);
  font-size: 13px;
}
#planner .plc-upcoming {
  padding: 22px 22px 10px;
  border-radius: 22px;
}
#planner .plc-upcoming h2 {
  margin: 0 0 6px !important;
  font-size: 22px;
}
.plc-upcoming ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.plc-upcoming li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.plc-upcoming li:first-child {
  border-top: 0;
}
.plc-upcoming li > div:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
#planner .plc-up-title {
  color: var(--ink) !important;
  font-size: 14px;
  font-weight: 600 !important;
  line-height: 1.35;
  text-align: left;
  text-decoration: none !important;
}
#planner .plc-up-title:hover {
  color: var(--gold-ink) !important;
}
.plc-upcoming small {
  color: var(--ink-muted);
  font-size: 12px;
}
/* дата-плочка (и в таблото) */
.plc-date {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 54px;
  border-radius: 12px;
  background: var(--paper-sunk);
}
.plc-date strong {
  font-family: 'Lora', Georgia, serif;
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
}
.plc-date span {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.plc-upcoming .plc-date {
  background: color-mix(in srgb, var(--k, var(--gold)) 14%, #fff);
}
.plc-upcoming .plc-date strong {
  color: color-mix(in srgb, var(--k, var(--gold)) 70%, var(--ink));
}
.plc-layout-year .plc-side {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
}
.plc-layout-year .plc-side > :only-child {
  grid-column: 1 / -1;
}
.plc-layout-year .plc-upcoming ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  column-gap: 28px;
}
.plc-layout-year .plc-upcoming li {
  border-top: 1px solid var(--line);
}

/* ---------- Цялата година ---------- */
.plc-year {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.plc-ym {
  padding: 14px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.plc-ym:hover {
  border-color: var(--gold-line, var(--line-strong));
  box-shadow: 0 6px 18px rgba(41, 39, 37, 0.06);
}
.plc-ym.is-current {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.plc-ym.is-wedding {
  border-color: var(--gold);
  background: linear-gradient(170deg, #fffdf8, #fbf1dc);
}
.plc-ym-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 10px;
}
#planner .plc-ym-name {
  min-height: 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: 'Lora', Georgia, serif;
  font-size: 18px;
  font-weight: 500;
  text-transform: capitalize;
  cursor: pointer;
}
#planner .plc-ym-name:hover {
  color: var(--gold-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.plc-ym-count {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 35px;
  background: var(--gold-soft);
  color: var(--gold-ink);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.plc-ym-heart {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
}
.plc-ym-heart svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}
.plc-ym-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.plc-ym-days > b {
  padding-bottom: 4px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}
.plc-ym-days > b.is-weekend {
  color: var(--gold);
}
#planner .plc-yd {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
#planner .plc-yd:hover {
  background: var(--paper-sunk);
}
#planner .plc-yd.is-weekend {
  color: var(--ink-muted);
}
#planner .plc-yd.has {
  color: var(--ink);
  font-weight: 700;
}
#planner .plc-yd-own {
  background: color-mix(in srgb, var(--plc-color, var(--gold)) 24%, #fff);
}
#planner .plc-yd-team {
  box-shadow: inset 0 0 0 1.5px var(--gold);
}
#planner .plc-yd-payment {
  background: color-mix(in srgb, var(--rose, #c47a7a) 22%, #fff);
}
#planner .plc-yd-task {
  background: color-mix(in srgb, var(--sage, #7c9a86) 22%, #fff);
}
#planner .plc-yd-event {
  background: var(--gold);
  color: #fff;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 3.5px var(--gold);
}
#planner .plc-yd.is-today {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
#planner .plc-yd.is-selected {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.plc-yd i {
  position: absolute;
  bottom: 1px;
  left: 50%;
  display: flex;
  gap: 2px;
  transform: translateX(-50%);
}
.plc-yd i b {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--k);
}

/* ---------- По-тесни екрани ---------- */
@media (max-width: 1280px) {
  .plc-year {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1000px) {
  .plc-layout,
  .plc-layout-year .plc-side {
    grid-template-columns: 1fr;
  }
  .plc-year {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  #planner .plc-main {
    padding: 18px 14px;
  }
  #planner .plc-nav h2 {
    flex-basis: 100%;
    font-size: 26px;
  }
  .plc-grid {
    gap: 4px;
  }
  .plc-dow {
    font-size: 10px;
    letter-spacing: 0.08em;
  }
  .plc-day {
    min-height: 62px;
    padding: 4px;
    border-radius: 10px;
  }
  #planner .plc-num {
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    font-size: 12px;
  }
  /* на телефон в плочката остават само цветни точки; подробностите са под календара */
  .plc-items {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 3px;
    padding-left: 3px;
    pointer-events: none;
  }
  #planner .plc-chip {
    width: auto;
    padding: 0;
    background: none !important;
    box-shadow: none !important;
  }
  #planner .plc-chip > span {
    display: none;
  }
  #planner .plc-chip.plc-k-event {
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold) !important;
  }
  #planner .plc-chip.plc-k-event svg {
    width: 9px;
    height: 9px;
  }
  #planner .plc-more {
    padding: 0 2px;
    font-size: 10px;
  }
  .plc-daypanel {
    padding: 14px;
  }
  .plc-daypanel-head {
    flex-wrap: wrap;
  }
  #planner .plc-daypanel h3 {
    font-size: 18px;
  }
  .plc-daylist li {
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 4px 10px;
  }
  .plc-daylist time {
    grid-column: 2;
    grid-row: 1;
  }
  .plc-daylist time:empty {
    display: none;
  }
  .plc-daylist .plc-row-title,
  .plc-daylist small {
    grid-column: 2;
    text-align: left;
  }
  .plc-daylist .plc-dot {
    grid-row: 1 / span 3;
    align-self: start;
    margin-top: 6px;
  }
  .plc-year {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .plc-ym {
    padding: 10px 8px;
  }
  #planner .plc-ym-name {
    font-size: 16px;
  }
  #planner .plc-yd {
    font-size: 11px;
  }
}
@media (max-width: 420px) {
  .plc-ym {
    padding: 8px 5px;
  }
  .plc-ym-days > b {
    font-size: 9px;
  }
  #planner .plc-yd {
    font-size: 10px;
  }
}
