.managed-form-field {
  min-width: 0;
}

.managed-date-input {
  display: block;
  position: relative;
}

.managed-date-input.is-open { z-index: 60; }

.managed-date-input > input {
  padding-right: 50px;
  width: 100%;
}

.managed-date-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #2458c7;
  cursor: pointer;
  display: flex;
  height: 38px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  z-index: 1;
}

.managed-date-toggle:hover { background: #edf4ff; }
.managed-date-icon { fill: none; height: 23px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 23px; }

.managed-date-toggle:focus-visible {
  outline: 3px solid rgba(47, 111, 237, .24);
  outline-offset: 1px;
}

.managed-date-calendar {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, .14);
  left: 0;
  padding: 12px;
  position: fixed;
  overflow-y: auto;
  top: 0;
  width: min(320px, calc(100vw - 48px));
  z-index: 10000;
}

.managed-date-calendar.opens-upward {
  bottom: auto;
}

.managed-calendar-header,
.managed-calendar-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.managed-calendar-header button,
.managed-calendar-footer button,
.managed-calendar-day {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #1f2937;
  cursor: pointer;
  font: inherit;
  min-height: 34px;
}

.managed-calendar-header button {
  font-size: 24px;
  width: 40px;
}

.managed-calendar-weekdays,
.managed-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.managed-calendar-weekdays {
  color: #64748b;
  font-size: 12px;
  margin: 10px 0 4px;
}

.managed-calendar-day:hover,
.managed-calendar-header button:hover,
.managed-calendar-footer button:hover {
  background: #edf4ff;
}

.managed-calendar-day.outside { color: #94a3b8; }
.managed-calendar-day.today { box-shadow: inset 0 0 0 1px #2f6fed; }
.managed-calendar-day.marked {
  position: relative;
  color: #9a4b00;
  background: rgba(245, 158, 11, .2);
}
.managed-calendar-day.marked::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 5px;
  height: 5px;
  background: #f59e0b;
  border-radius: 50%;
  transform: translateX(-50%);
}
.managed-calendar-day.selected { color: #fff; background: #2f6fed; }
.managed-calendar-day.selected.marked::after { background: #f59e0b; }
.managed-calendar-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 8px 4px 0;
  color: #7c4a03;
  border-top: 1px solid #dfe5ee;
  font-size: 12px;
  font-weight: 700;
}
.managed-calendar-legend i {
  width: 15px;
  height: 15px;
  background: rgba(245, 158, 11, .2);
  border-radius: 4px;
}
.managed-calendar-footer { border-top: 1px solid #dfe5ee; margin-top: 8px; padding-top: 8px; }
.managed-calendar-footer button { color: #2458c7; font-weight: 700; padding: 0 10px; }

.connection.connection-button {
  border: 1px solid currentColor;
  cursor: pointer;
  font: inherit;
}

.connection.server-unreachable,
.connection.offline,
.connection.auth-error {
  background: #fff1ef;
  color: #a83d30;
}

.diagnostics-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.diagnostics-card {
  background: #f8fafc;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 14px;
}

.diagnostics-card span { color: #64748b; font-size: 13px; }
.diagnostics-card strong { overflow-wrap: anywhere; }
.diagnostics-note { color: #64748b; line-height: 1.6; margin: 14px 0 0; }

@media (max-width: 640px) {
  .diagnostics-grid { grid-template-columns: 1fr; }
  .managed-date-calendar { max-width: calc(100vw - 24px); }
}
