:root {
  --ko-accent: #f3a516;
  --ko-accent-dark: #cf8500;
  --ko-panel: rgba(12, 12, 12, 0.96);
  --ko-cell: #f4f4f4;
  --ko-cell-muted: #e8e8e8;
  --ko-border: #d5d5d5;
  --ko-text: #171717;
  --ko-muted: #777;
  --ko-danger: #c62828;
}

.ko-calendar,
.ko-calendar * {
  box-sizing: border-box;
}

.ko-calendar {
  width: 100%;
  max-width: 1200px;
  margin: 20px auto;
  padding: 18px;
  border-radius: 12px;
  background: var(--ko-panel);
  color: #fff;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.35);
}

.ko-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.ko-toolbar-group {
  display: flex;
  gap: 7px;
  justify-self: start;
}

.ko-month-title {
  margin: 0;
  text-align: center;
  font-size: clamp(19px, 2.6vw, 28px);
  color: #fff;
  text-transform: capitalize;
}

.ko-legend {
  justify-self: end;
  color: #ddd;
  font-size: 13px;
}

.ko-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 3px;
  background: var(--ko-accent);
}

.ko-btn {
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
  transition: 0.15s ease;
}

.ko-btn:hover {
  transform: translateY(-1px);
}

.ko-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ko-btn-icon,
.ko-btn-today,
.ko-btn-save {
  min-height: 38px;
  padding: 0 14px;
  background: var(--ko-accent);
  color: #111;
}

.ko-btn-icon {
  min-width: 40px;
  padding: 0;
  font-size: 25px;
  line-height: 1;
}

.ko-btn-icon:hover,
.ko-btn-today:hover,
.ko-btn-save:hover {
  background: var(--ko-accent-dark);
}

.ko-weekdays,
.ko-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.ko-weekdays > div {
  padding: 9px 4px;
  text-align: center;
  background: var(--ko-accent);
  color: #111;
  border-right: 1px solid rgba(0, 0, 0, 0.18);
  font-size: 13px;
  font-weight: 800;
}

.ko-weekdays > div:first-child {
  border-radius: 7px 0 0 0;
}

.ko-weekdays > div:last-child {
  border-right: 0;
  border-radius: 0 7px 0 0;
}

.ko-day {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 135px;
  padding: 8px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--ko-border);
  border-bottom: 1px solid var(--ko-border);
  background: var(--ko-cell);
  color: var(--ko-text);
  text-align: left;
  cursor: pointer;
}

.ko-day:nth-child(7n + 1) {
  border-left: 1px solid var(--ko-border);
}

.ko-day:hover {
  background: #fff5d8;
}

.ko-day.ko-outside {
  background: var(--ko-cell-muted);
  color: #aaa;
}

.ko-day.ko-today {
  box-shadow: inset 0 0 0 3px var(--ko-accent);
}

.ko-day-number {
  align-self: flex-end;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 800;
}

.ko-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ko-event {
  display: block;
  width: 100%;
  padding: 4px 6px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--ko-accent);
  color: #151515;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ko-login-note {
  margin: 12px 0 0;
  color: #bbb;
  font-size: 13px;
}

.ko-modal[hidden] {
  display: none !important;
}

.ko-modal {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
}

.ko-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.ko-modal-box {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px;
  border: 1px solid rgba(243, 165, 22, 0.45);
  border-radius: 12px;
  background: #171717;
  color: #fff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
}

.ko-modal-box h3 {
  margin: 0 36px 2px 0;
  color: #fff;
}

.ko-selected-date {
  margin: 4px 0 16px;
  color: var(--ko-accent);
  font-weight: 700;
}

.ko-modal-x {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.ko-modal form {
  display: grid;
  gap: 8px;
}

.ko-modal label {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.ko-modal input::placeholder {
    color: #000;
    opacity: 1;
}

.ko-modal input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #555;
  border-radius: 7px;
  background: #fff;
  color: #111;
  font-size: 15px;
}

.ko-btn-save {
  margin-top: 4px;
}

.ko-day-events {
  margin-top: 22px;
}

.ko-day-events h4 {
  margin: 0 0 8px;
  color: #fff;
}

.ko-modal-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding: 9px 10px;
  border-radius: 7px;
  background: #292929;
}

.ko-modal-event span {
  overflow-wrap: anywhere;
}

.ko-modal-event button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--ko-danger);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
}

.ko-empty {
  color: #aaa;
}

body.ko-modal-open {
  overflow: hidden;
}

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

  .ko-toolbar {
    grid-template-columns: 1fr;
  }

  .ko-toolbar-group,
  .ko-legend {
    justify-self: center;
  }

  .ko-month-title {
    grid-row: 1;
  }

  .ko-legend {
    display: none;
  }

  .ko-weekdays > div {
    font-size: 10px;
  }

  .ko-day {
    min-height: 90px;
    padding: 4px;
  }

  .ko-day-number {
    font-size: 10px;
  }

  .ko-event {
    padding: 3px;
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .ko-day {
    min-height: 72px;
  }

  .ko-event {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* Naprawa koloru wpisywanego tekstu */
.ko-modal input,
.ko-modal input:focus,
.ko-modal input:active,
.ko-modal input:hover {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    caret-color: #000 !important;
}

/* Placeholder */
.ko-modal input::placeholder {
    color: #999 !important;
    opacity: 1;
}